dojo.date.difference
dojo.require("dojo.date");
defined in dojo/date.js
Get the difference in a specific unit of time (e.g., number of months, weeks, days, etc.) between two dates, rounded to the nearest integer.
parameter | type | description |
---|---|---|
date1 | Date | object |
date2 | Date | Optional. object. If not specified, the current Date is used. |
interval | String | Optional. A string representing the interval. One of the following: "year", "month", "day", "hour", "minute", "second", "millisecond", "quarter", "week", "weekday" Defaults to "day". |