Removed timezone offset in date picker
authorAlexander Ebert <ebert@woltlab.com>
Thu, 27 Feb 2014 17:16:08 +0000 (18:16 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 27 Feb 2014 17:16:08 +0000 (18:16 +0100)
wcfsetup/install/files/js/WCF.js

index b9b3021afde37a32ec75b4420098b021609f73b6..1c3e870126374ae070936c88b1d171f85f0e82c2 100755 (executable)
@@ -2898,6 +2898,12 @@ WCF.Date.Picker = {
                        
                        // format default date
                        if ($inputValue) {
+                               if (!$hasTime) {
+                                       // drop timezone for date-only input
+                                       $inputValue = new Date($inputValue);
+                                       $inputValue.setMinutes($inputValue.getMinutes() + $inputValue.getTimezoneOffset());
+                               }
+                               
                                $input.datepicker('setDate', $inputValue);
                        }