d2l-insights-daterange-input v0.12.0
d2l-insights-daterange-input
Overview
This library contains the date range input control.
API Docs
init(parentElement, defaultStartTimestamp, defaultEndTimestamp, timezone, fnVerifyAndSetCustomDateRange)
Please note: the signature of this function has changed in v0.11.0.
Perform initialization of the widget and hook up events on the page element, be aware of memory leak since there's no unhook of the events.
parentElementThe parent element that contains the widget, the content of the element will be populated with the HTML structure of this widgetdefaultStartTimestampThe defaultStartTimestamp of the widget, expected to be a timestamp in milliseconds.defaultEndTimestampThe defaultEndDate of the widget, expected to be a timestamp in milliseconds.timezoneThe timezone used to represent dates, e.g.America/TorontoorAustralia/Hobart. Defaults toUTCfnVerifyAndSetCustomDateRange(startTimestamp, endTimestamp).
A callback function which will get called whenever the date input is changed. It will be called with the startTime and endTime as parameter (in milliSeconds). The startTime and endTime should be already verified by the module by then.
updateDateValues(startTimestamp, endTimestamp)
Update the date values of the widget with startTimestamp and endTimestamp, the update will trigger the verification and update event, and the callback will be called.
render(parentElementId)
Populate page element with parentElementId with the HTML structure of this widget. You are expected to call render(parentElementId) before calling init() with same parentElementId.