Returns the number of days between two DateTime instances.
Namespace: MindFusion.Scheduling
Assembly: DateTime.js
SyntaxJavaScript
Copy Code
|
|---|
function daysBetween (date1, date2) |
DateTime. The first DateTime instance.
DateTime. The second DateTime instance.
Number. The number of days.
ExampleThe following code gets the first day of the week that contains the current calendar date. Then it sets the days between the start and end date of a calendar as a value to an HTML DOM element:
JavaScript
Copy Code
|
|---|
| var startDate = p.DateTime.getWeekFirstDate(calendar.date); document.getElementById("totalDays").value = p.DateTime.daysBetween(startDate, calendar.endDate) + 1; |
See Also