diff options
Diffstat (limited to 'framework/Web/Javascripts')
-rw-r--r-- | framework/Web/Javascripts/js/validator.js | 6 | ||||
-rw-r--r-- | framework/Web/Javascripts/prado/validation3.js | 12 |
2 files changed, 16 insertions, 2 deletions
diff --git a/framework/Web/Javascripts/js/validator.js b/framework/Web/Javascripts/js/validator.js index ee578ea2..0e39d191 100644 --- a/framework/Web/Javascripts/js/validator.js +++ b/framework/Web/Javascripts/js/validator.js @@ -125,7 +125,11 @@ return value;},getValidationValue:function(control) control=this.control switch(this.options.ControlType) {case'TDatePicker':if(control.type=="text") -return this.trim($F(control));else +{value=this.trim($F(control));if(this.options.DateFormat) +{date=value.toDate(this.options.DateFormat);return date==null?'':date;} +else +return value;} +else {this.observeDatePickerChanges();return Prado.WebUI.TDatePicker.getDropDownDate(control).getTime();} case'THtmlArea':if(typeof tinyMCE!="undefined") tinyMCE.triggerSave();return this.trim($F(control));case'TRadioButton':if(this.options.GroupName) diff --git a/framework/Web/Javascripts/prado/validation3.js b/framework/Web/Javascripts/prado/validation3.js index f5f058c8..b1b20722 100644 --- a/framework/Web/Javascripts/prado/validation3.js +++ b/framework/Web/Javascripts/prado/validation3.js @@ -767,7 +767,17 @@ Prado.WebUI.TBaseValidator.prototype = {
case 'TDatePicker':
if(control.type == "text")
- return this.trim($F(control));
+ {
+ value = this.trim($F(control));
+
+ if(this.options.DateFormat)
+ {
+ date = value.toDate(this.options.DateFormat);
+ return date == null ? '' : date;
+ }
+ else
+ return value;
+ }
else
{
this.observeDatePickerChanges();
|