Arian : Mootools-datepicker : Parse date with the option format first (propose on...
authorBenjamin Renard <brenard@easter-eggs.com>
Mon, 27 Jun 2011 10:05:56 +0000 (12:05 +0200)
committerBenjamin Renard <brenard@easter-eggs.com>
Mon, 27 Jun 2011 10:06:09 +0000 (12:06 +0200)
public_html/includes/libs/arian-mootools-datepicker/Picker.Date.js

index aae7cd8..dcceb4d 100644 (file)
@@ -115,7 +115,10 @@ this.DatePicker = Picker.Date = new Class({
                        }
                        this.date = new Date();
                        if (input){
-                               var date = Date.parse(input.get('value'));
+                               var date = Date.parse(input.get('value'),options.format);
+                               if (date == null){
+                                       date = Date.parse(input.get('value'));
+                               }
                                if (date == null || !date.isValid()){
                                        var storeDate = input.retrieve('datepicker:value');
                                        if (storeDate) date = Date.parse(storeDate);