From 10ef09c5e7971bcceaf3c99d0788e664409546f1 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Mon, 27 Jun 2011 12:05:56 +0200 Subject: [PATCH] Arian : Mootools-datepicker : Parse date with the option format first (propose on github https://github.com/arian/mootools-datepicker/pull/50) --- .../includes/libs/arian-mootools-datepicker/Picker.Date.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public_html/includes/libs/arian-mootools-datepicker/Picker.Date.js b/public_html/includes/libs/arian-mootools-datepicker/Picker.Date.js index aae7cd8e..dcceb4dd 100644 --- a/public_html/includes/libs/arian-mootools-datepicker/Picker.Date.js +++ b/public_html/includes/libs/arian-mootools-datepicker/Picker.Date.js @@ -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);