height: Math.max($(window).height() - 15 * this.pxPerEm, 400),
width: Math.max($(window).width() - 6 * this.pxPerEm, 800)
};
+ },
+ initPicker: function(from, to, updatePicker) {
+ [$(from), $(to)].forEach(function(input) {
+ var prev, ignore;
+ input.datetimepicker({
+ onSelectDate: function() {
+ ignore = true;
+ }
+ });
+ input.change(function() {
+ if (ignore) {
+ ignore = false;
+ return;
+ }
+ var cur = input.val();
+ if (typeof cur !== 'string' || cur === prev)
+ return;
+ prev = cur;
+ input.datetimepicker({value: cur});
+ updatePicker(input);
+ });
+ });
}
};