Search
TimeRange.sameStart Method
See Also
 






Checks if the current range starts at the same time as the specified range.

Namespace: MindFusion.Scheduling
File: TimeRange.js

 Syntax

JavaScript  Copy Code

function sameStart (range)

 Parameters

range

TimeRange. The range of DateTime values to compare to.

 Return Value

Boolean. true if the current range starts at the same time with the specified range; otherwise false.

 Example

The following code creates a range at the end of December and checks if the current calendar selection starts at the same time as the holiday range:

JavaScript  Copy Code

var p = MindFusion.Scheduling;

// create a new instance of the calendar
var calendar = new p.Calendar(document.getElementById("calendar"));

var selectedRange = calendar.selection.getRange();

var holidayStart = p.DateTime.fromDateParts(2018, 12, 20);
var holidayEnd = p.DateTime.addDays(holidayStart.clone(),14);

var holidayRange = new TimeRange(holidayStart, holidayEnd);

if (selectedRange.sameStart(holidayRange))
{
    //do something
}

 See Also