Returns the number of days between two DateTime instances.
Namespace: MindFusion.Scheduling
File: DateTime.js
JavaScript Copy Code |
---|
function daysBetween (date1, date2) |
DateTime. The first DateTime instance.
DateTime. The second DateTime instance.
Number. The number of days.
The 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; |
JavaScript Pack Programmer's Guide | © 2024 MindFusion |