Search
DateTime.daysBetween Method
See Also
 






Returns the number of days between two DateTime instances.

Namespace: MindFusion.Scheduling
File: DateTime.js

 Syntax

JavaScript  Copy Code

function daysBetween (date1, date2)

 Parameters

date1

DateTime. The first DateTime instance.

date2

DateTime. The second DateTime instance.

 Return Value

Number. The number of days.

 Example

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;

 See Also