Date provides a set of utility functions to operate against Date objects.
addDaysoDate
numDays
Adds a specified number of days to the given date.
addMonthsoDate
numMonths
Adds a specified number of months to the given date.
addYearsoDate
numYears
Adds a specified number of years to the given date.
areEqualaDate
bDate
Checks whether two dates correspond to the same date and time.
daysInMonthoDate
Takes a native JavaScript Date and returns the number of days in the month that the given date belongs to.
oDate
Date
Date in the month for which the number of days is desired.
formatoDate
oConfig
Takes a native JavaScript Date and formats it as a string for display to user.
oDate
Date
Date.
oConfig
Object
(Optional) Object literal of configuration values:
Any strftime string is supported, such as "%I:%M:%S %p". strftime has several format specifiers defined by the Open group at http://www.opengroup.org/onlinepubs/007908799/xsh/strftime.html PHP added a few of its own, defined at http://www.php.net/strftime
This javascript implementation supports all the PHP specifiers and a few more. The full list is below.
If not specified, it defaults to the ISO 8601 standard date format: %Y-%m-%d.
isGreateraDate
bDate
Checks whether the first date comes later than the second.
isGreaterOrEqualaDate
bDate
Checks whether the first date comes later than or is the same as the second.
isInRangeaDate
bDate
cDate
Checks whether the date is between two other given dates.
isValidDateoDate
Checks whether a native JavaScript Date contains a valid value.
oDate
Date
Date in the month for which the number of days is desired.
listOfDatesInMonthoDate
Lists all dates in a given month.
oDate
Date
The date corresponding to the month for which a list of dates is required.