These docs are for v0.1.0. Click to read the latest docs for v1.0.0.

Front.promptDate(options, callback)

Display a dialog to select a date. It will pass the callback a Javascript Date (or false if the user canceled).

options: object

Field NameTypeDescription
positionobject (Integer, Integer)Position of the prompt in number of pixels from the left and top sides of the page.
val (optional)DateDefault date when the prompt is opened.
before (optional)DateThe latest date the user is allowed to select.
after (optional)DateThe earliest date the user is allowed to select.

callback: function

A callback function.

var position = {
    left: event.screenX - window.screenX,
    top: event.screenY - window.screenY,
};

Front.promptDate({
    position: position,
    val: defaultDate,
    before: forceSelectionBefore,
    after: forceSelectionAfter
}, function (date) {
    console.log('User selected:', date);
}));