DatePicker.DatePickerDesignerView.prototype = {
initialize: function () {
DatePicker.DatePickerDesignerView.callBaseMethod(this, 'initialize');
},
dispose: function () {
DatePicker.DatePickerDesignerView.callBaseMethod(this, 'dispose');
},
//properties
get_minimumPicker: function () { return this._minimumPicker; },
set_minimumPicker: function (value) { this._minimumPicker = value },
get_maximumPicker: function () { return this._maximumPicker; },
set_maximumPicker: function (value) { this._maximumPicker = value },
// implementation of IDesignerViewControl: Forces the control to refersh from the control Data
refreshUI: function () {
var controlData = this.get_controlData();
var maximum = Sys.Serialization.JavaScriptSerializer.deserialize(controlData.Maximum);
this._maximumPicker.set_selectedDate(maximum);
var minimum = Sys.Serialization.JavaScriptSerializer.deserialize(controlData.Minimum);
this._minimumPicker.set_selectedDate(minimum);
},
// implementation of IDesignerViewControl: forces the designer view to apply the changes on UI to the control Data
applyChanges: function () {
var controlData = this.get_controlData();
var maximumDate = (new Date(this._maximumPicker.get_selectedDate())).format("MM/dd/yyyy h:mm:ss");
var minimumDate = (new Date(this._minimumPicker.get_selectedDate())).format("MM/dd/yyyy h:mm:ss");
controlData.Maximum = Sys.Serialization.JavaScriptSerializer.serialize(GetUserPreferences().sitefinityToUniversalDate(maximumDate));
controlData.Minimum = Sys.Serialization.JavaScriptSerializer.serialize(GetUserPreferences().sitefinityToUniversalDate(minimumDate));
},
// gets the javascript control object that is being designed
get_controlData: function () {
return this.get_parentDesigner().get_propertyEditor().get_control();
},
get_parentDesigner: function () {
return this._parentDesigner;
},
// IDesignerViewControl: sets the reference fo the propertyEditor control
set_parentDesigner: function (value) {
this._parentDesigner = value;
}
}