SimileAjax/Units

= SimileAjax Units =

There is no SimileAjax.Units namespace, there is instead a NativeDateUnit object that provides some convenience functions for dealing with the native Date type provided by Javascript.

Code: http://api.simile-widgets.org/ajax/2.2.1/scripts/units.js

Back to SimileAjax.

SimileAjax.NativeDateUnit.makeDefaultValue

 * Arguments: None
 * Returns:
 * Description: Returns a native  object representing now.

SimileAjax.NativeDateUnit.cloneValue

 * Arguments:
 * v:
 * Returns:
 * Description: Creates a new object with the same value as an existing  object.

SimileAjax.NativeDateUnit.getParser

 * Arguments:
 * format: string, One of "iso8601", "iso 8601", or anything else
 * Returns: function
 * Description: Returns a function capable of parsing the format described; anything other than ISO8601 will be treated as a Gregorian date.

SimileAjax.NativeDateUnit.parseFromObject

 * Arguments:
 * o: object
 * Returns:
 * Description: Passes through to Gregorian parser

SimileAjax.NativeDateUnit.toNumber

 * Arguments:
 * v:
 * Returns: int
 * Description: Gets value of date in seconds from epoch

SimileAjax.NativeDateUnit.fromNumber

 * Arguments:
 * n: int
 * Returns:
 * Description: Returns  given seconds from epoch

SimileAjax.NativeDateUnit.compare

 * Arguments:
 * v1:  or float
 * v2:  or float
 * Returns: int or float, negative if v1 is less than v2, 0 if equal, positive if v1 is greater than v2
 * Description: Compares dates, returning values binned to negative, 0, and positive accordingly

SimileAjax.NativeDateUnit.earlier

 * Arguments:
 * v1:  or float
 * v2:  or float
 * Returns: boolean, true if v1 is absolutely earlier than v2, false otherwise
 * Description: Passes through to comparison method above.

SimileAjax.NativeDateUnit.later

 * Arguments:
 * v1:  or float
 * v2:  or float
 * Returns: boolean, true if v1 is absolutely later than v2, false otherwise
 * Description: Passes through to comparison method above.

SimileAjax.NativeDateUnit.change

 * Arguments:
 * v:
 * n: int
 * Returns:
 * Description: Increments the date  by the number of seconds.

Back to SimileAjax.