Creates a new DateTime object, by specifying its different date and time components.
Namespace: MindFusion.Scheduling
File: DateTime.js
JavaScript Copy Code |
---|
function fromDateParts (year, month, [day, [hours, [minutes, [seconds, [milliseconds]]]]]) |
Number. The year component.
Number. The month component (0-11).
Number. The day component (1-31). If not provided, a default value of 1 will be used.
Number. The hours component (0-23). If not provided, a default value of 0 will be used.
Number. The minutes component (0-59). If not provided, a default value of 0 will be used.
Number. The seconds component (0-59). If not provided, a default value of 0 will be used.
Number. The milliseconds component (0-999). If not provided, a default value of 0 will be used.
The new DateTime object, or null if a DateTime instance cannot be created from the provided values.
The following code loads calendar data from a JSON array:
JavaScript Copy Code |
---|
function loadCalendar(data) // traverse the json object and create corresponding items in the calendar schedule |