date picker no longer sets a value if empty
authorAlexander Ebert <ebert@woltlab.com>
Thu, 31 Jan 2013 22:20:02 +0000 (23:20 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 31 Jan 2013 22:20:02 +0000 (23:20 +0100)
wcfsetup/install/files/js/WCF.js

index 4f004cf6c815868e5589a19f6fec7e652a34ddc6..e3aa812714be813f017415cd5392b38e4bae99f2 100755 (executable)
@@ -2089,6 +2089,10 @@ WCF.Date = {};
  * Provides a date picker for date input fields.
  */
 WCF.Date.Picker = {
+       /**
+        * date format
+        * @var string
+        */
        _dateFormat: 'yy-mm-dd',
        
        /**
@@ -2188,7 +2192,9 @@ WCF.Date.Picker = {
                        });
                        
                        // format default date
-                       $input.datepicker('setDate', new Date($inputValue));
+                       if ($inputValue) {
+                               $input.datepicker('setDate', new Date($inputValue));
+                       }
                        
                        // bug workaround: setDate creates the widget but unfortunately doesn't hide it...
                        $input.datepicker('widget').hide();