123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
'use strict';
modulum('DateTimeEditWidget', ['DateEditWidget', 'WidgetFactory'],
function(context, cls) {
cls.DateTimeEditWidget = context.oo.Class(cls.DateEditWidget, function($super) {
return {
__name: 'DateTimeEditWidget',
_coeffMaxHeight: 425,
_initLayout: function() {
if (!this._ignoreLayout) {
this._layoutInformation = new cls.LayoutInformation(this);
this._layoutEngine = new cls.LeafLayoutEngine(this);
this._layoutInformation.setSingleLineContentOnly(true);
}
},
_initElement: function() {
$super._initElement.call(this, true);
this._displayFormat = 'MM/DD/YYYY HH:mm:ss';
},
_getPickerConf: function() {
var pickerConf = $super._getPickerConf.call(this);
pickerConf.showTime = true;
pickerConf.showSeconds = this._showSeconds;
return pickerConf;
},
setFormat: function(format) {
$super.setFormat.call(this, format);
this._showSeconds = Boolean(~format.toLowerCase().indexOf('s'));
if (this._picker) {
this._picker.destroy();
}
this.initDatePicker();
}
};
});
cls.WidgetFactory.registerBuilder('DateTimeEdit', cls.DateTimeEditWidget);
});