Adds useful methods to the JavaScript Date type.
To use this optional module, its repository needs to be added to the application, for example by calling app.addRepository('modules/core/Date.js')
To use this optional module, its repository needs to be added to the application, for example by calling app.addRepository('modules/core/Date.js')
Methods
Format a Date to a string.
For details on the format pattern, see
http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html
parameters
String | Format pattern | |
Object | Java Locale Object (optional) | |
Object | Java TimeZone Object (optional) |
returns
String formatted Date |
set the date/time to UTC by subtracting
the timezone offset
set the date/time to local time by adding
the timezone offset
returns the difference between this and another
date object in milliseconds
parameters
dateObj |
return the timespan to current date/time or a different Date object
parameters
Object | parameter object containing optional properties: .now = String to use if difference is < 1 minute .day|days = String to use for single|multiple day(s) .hour|hours = String to use for single|multiple hour(s) .minute|minutes = String to use for single|multiple minute(s) .date = Date object to use for calculating the timespan |
returns
Object containing properties: .isFuture = (Boolean) .span = (String) timespan |
see
return the past timespan between this Date object and
the current Date or a different Date object
parameters
param |
see
return the future timespan between this Date object and
the current Date or a different Date object
parameters
param |
see
checks if a date object equals another date object
parameters
Object | Date object to compare | |
Int | indicating how far the comparison should go |
returns
Boolean |