DateObject |
Stores dates, both absolute and relative, and calculates differences. This is a generic class that may be used in a variety of ways and is required by some API classes for date calculations.
__/ REQUIREMENTS \__
ActionScript 3.0 (or later)
__/ IMPORTS \__
com.bnm.api.CoreData flash.utils.*
__/ EXTENDS \__
com.bnm.api.CoreData
__/ IMPLEMENTS \__
nothing
__/ NOTICE \__
©opyright 2008 Bay New Media. All rights, as stipulated in the The MIT License, are reserved.
This ActionScript library is licensed and released under the MIT License (http://www.opensource.org
Please visit http://www.baynewmedia.com/ or email con@baynewm edia.com for information, questions, concerns, or bug reports. tact
__/ NOTES \__
This class is commented using the NaturalDocs documentation system. It is intended to be easily read both from the direct source code and from an adaptation that is generated as hyperlinked HTML. The NaturalDocs specification used in this class’ documentation is version 1.35 though older versions may probably be used safely. For more information, please visit: http://www.naturaldocs.org/
The BNMAPI is officially available (primary sources) on Source Forge (http://sourceforge.net/projects/bnmapi/), on the Bay New Media site (http;//www.baynewmedia.com/), on the PeaBee project site (http://www.peabee.com/), and through the Bay New Media SVM repository server (visit http://www.baynewmedia.com/ for more information). Downloads from other sources may not be complete or up-to-date.
If you’re interested in joining the BNMAPI project in any capacity (development, testing, distribution, etc.), please visit us on Source Forge or the Bay New Media web site.
DateObject | Stores dates, both absolute and relative, and calculates differences. |
Variables | |
_date | (Date) An internal <Date> object against with which to perform date calculations or with which to compare other date objects (for deltas, for example). |
Functions and Properties | |
DateObject | Creates a new DateObject instance. |
isLater | Compares the current DateObject instance and the supplied parameter and returns TRUE if the current instance is later than the parameter DateObject. |
isSame | Compares the current DateObject instance and the supplied parameter and returns TRUE if both instance are the same date. |
getDaysPerMonth | Returns the days per month for the specified month and for the specified year, if supplied. |
getMonthNumber | Returns the number of the month (0-based) of the specified month string representation. |
get dateIndex | Returns a specially formatted unsigned integer that combines the DateObject’s date, month, and year values. |
dateIndex | |
get date | Returns the date object used to store and manipulate date information for this class instance. |
date | |
get day | Returns the day number of the current date object within the current date object’s month. |
day | |
get month | Returns the month number of the current date object. |
month | |
get year | Returns the full year of the current date object. |
year | |
get dayOfWeek | Returns the date of teh week associated with the current instance. |
dayOfWeek | |
toString | The default return handler for any object-to-string requests such as trace statements. |
private var _date: Date
(Date) An internal <Date> object against with which to perform date calculations or with which to compare other date objects (for deltas, for example). This value is set, by default, to the current system date, but can be updated either via the constructor or via a setter.
public function DateObject( ... args )
Creates a new DateObject instance. This instance can be used for a variety of date and relative date related tasks.
date (untyped, optional): A date value to assign to this class instance. This may be any value that can be passed to a standard <Date> object constructor. If not passed, the current system date/time is assigned to this object at instantiation.
DateObject: A newly created class instance.
nothing
nothing
no
public function isLater( date: DateObject ):Boolean
Compares the current DateObject instance and the supplied parameter and returns TRUE if the current instance is later than the parameter DateObject.
date (DateObject, required): The DateObject instance to compare to the current instance.
Boolean: TRUE if the `date` parameter is earlier in the calendar than this instance. FALSE is returned if the current instance is earlier in the calendar, if both objects are the same date, or if the parameter supplied is incorrect.
nothing
nothing
no
public function isSame( date: DateObject ):Boolean
Compares the current DateObject instance and the supplied parameter and returns TRUE if both instance are the same date.
date (DateObject, required): The DateObject instance to compare to the current instance.
Boolean: TRUE if the `date` parameter is the same date as the current instance.
nothing
nothing
no
public function getDaysPerMonth ( ... args ):uint
Returns the days per month for the specified month and for the specified year, if supplied.
month (untyped, optional): Either a string representation of a month, or a numeric (0-based) month number. If omitted, the current moth is used. year (uint, optional): The year for which to return the month for (this affected February during leap years). If omitted, the current year is used.
uint: The number of days contained in the specified month.
nothing
nothing
no
public function getMonthNumber( monthName: String ):uint
Returns the number of the month (0-based) of the specified month string representation. Valid month formats include “January”, “jan”, “Jan.”, etc.
monthName (String, required): The name of the month to evaluate.
uint: The 0-based number of the month. That is, 0=January, 1=February, 2=March, etc. NULL is returned if an invalid month name is provided.
nothing
nothing
no
Returns a specially formatted unsigned integer that combines the DateObject’s date, month, and year values. The format is YYYYMMDD. This can allow the date object to be used as a unique index value in sorted data sets like numeric arrays.
uint: An unsigned integer index based on the date value of the instance. This is in the format YYYYMMDD. Values that are less than 10 are padded with an extra 0 to ensure that index valued and data length are retained.
nothing
nothing
no
Returns the day number of the current date object within the current date object’s month.
Number: The current day of the month of the date object associated with this DateObject instance.
nothing
nothing
no
Returns the month number of the current date object.
Number: The current month of the current DateObject instance. This uses the same numbering scheme as the <Date.getMonth> method.
nothing
nothing
no
Returns the full year of the current date object.
Number: The current year of the current DateObject instance. This uses the same numbering scheme as the <Date.getFullYear> method.
nothing
nothing
no
Returns the date of teh week associated with the current instance.
Number: The day of the week (starting with 0 representing Sunday) of the current DateObject instance. This corresponds to the values returned by the <Date.getDay> method.
nothing
nothing
no
override public function toString():String
The default return handler for any object-to-string requests such as trace statements.
none
String: The date string of the internal _date object, as generated by the `toDateString` method of the <Date> class.
nothing
nothing
no
(Date) An internal Date object against with which to perform date calculations or with which to compare other date objects (for deltas, for example).
private var _date: Date
Creates a new DateObject instance.
public function DateObject( ... args )
Compares the current DateObject instance and the supplied parameter and returns TRUE if the current instance is later than the parameter DateObject.
public function isLater( date: DateObject ):Boolean
Compares the current DateObject instance and the supplied parameter and returns TRUE if both instance are the same date.
public function isSame( date: DateObject ):Boolean
Returns the days per month for the specified month and for the specified year, if supplied.
public function getDaysPerMonth ( ... args ):uint
Returns the number of the month (0-based) of the specified month string representation.
public function getMonthNumber( monthName: String ):uint
public function get dateIndex():uint
public function get date():Date
public function get day():Number
public function get month():Number
public function get year():Number
public function get dayOfWeek():Number
The default return handler for any object-to-string requests such as trace statements.
override public function toString():String