Functiondojo.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.

Usage

function (/*Date*/ date1, /*Date?*/ date2, /*String?*/ interval) (view source)
parametertypedescription
date1Dateobject
date2DateOptional. object. If not specified, the current Date is used.
intervalStringOptional. A string representing the interval. One of the following: "year", "month", "day", "hour", "minute", "second", "millisecond", "quarter", "week", "weekday" Defaults to "day".