2017-10-22 18:00:42 +00:00
|
|
|
if (typeof jQuery === 'undefined') {
|
|
|
|
throw new Error('Baby Buddy requires jQuery.')
|
|
|
|
}
|
2020-01-27 22:56:37 +00:00
|
|
|
if (typeof moment === 'undefined') {
|
|
|
|
throw new Error('Baby Buddy requires moment.js.')
|
|
|
|
}
|
2017-10-22 18:00:42 +00:00
|
|
|
|
2020-01-27 22:56:37 +00:00
|
|
|
/**
|
|
|
|
* Baby Buddy Namespace
|
|
|
|
*
|
|
|
|
* Default namespace for the Baby Buddy app.
|
|
|
|
*/
|
2017-10-22 18:00:42 +00:00
|
|
|
var BabyBuddy = function () {
|
2020-01-27 22:56:37 +00:00
|
|
|
return {};
|
2017-10-22 18:00:42 +00:00
|
|
|
}();
|
2020-01-27 22:56:37 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Baby Buddy Datetime Picker
|
|
|
|
*
|
|
|
|
* Provides modifications and defaults for the base datetime picker widget.
|
|
|
|
*/
|
|
|
|
BabyBuddy.DatetimePicker = function ($, moment) {
|
|
|
|
return {
|
|
|
|
init: function (element, options) {
|
|
|
|
var defaultOptions = {
|
2020-01-28 04:40:52 +00:00
|
|
|
allowInputToggle: true,
|
2020-01-27 22:59:40 +00:00
|
|
|
buttons: { showToday: true, showClose: true },
|
2020-01-27 22:56:37 +00:00
|
|
|
defaultDate: 'now',
|
|
|
|
format: 'L LT',
|
|
|
|
ignoreReadonly: true,
|
|
|
|
locale: moment.locale(),
|
|
|
|
useCurrent: false
|
|
|
|
};
|
|
|
|
element.datetimepicker($.extend(defaultOptions, options));
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}(jQuery, moment);
|