Just something I’ll add on to.
It gives out the full date and the day of the week by name.
Michael, my script is up.
Just something I’ll add on to.
It gives out the full date and the day of the week by name.
Michael, my script is up.
Added this method to the class…
/**
* Override of the getDate() method. Here we allow for you to specify whether to include the prefix.
*
* @usage
* <code>
* import createage.date.DateTime;
* var date = new DateTime();
* trace( date.getDate() ); // the date no suffix
* trace( date.getDate(false) ); // the date no suffix
* trace( date.getDate(true) ); // the date with it's proper suffix
* </code>
* @param Whether or not to return the date with it's suffix, eg: 1st, 2nd, 21st, 25th.
* @return The day of the month for this DateTime object.
*/
public function getDate( suffix:Boolean ) : Object
{
var date : Number = super.getDate();
if (!suffix || suffix == undefined) return date;
var suf : String = "";
var sig_num : Number = ( (date/10) % 1 ) * 10;
if ((sig_num >= 4 && sig_num <= 9) || sig_num == 0 || (date < 20 && date > 9))
{
suf = "th";
} else if (sig_num == 1)
{
suf = "st";
} else if (sig_num == 2)
{
suf = "nd";
} else if (sig_num == 3)
{
suf = "rd";
}
return date+suf;
}
Take Care.
_Michael
I don’t get it. I see nothing Code wise or swf…?
:: Copyright KIRUPA 2024 //--