`Number.isNaN()` is part of ES6 and not yet fully supported
authorAlexander Ebert <ebert@woltlab.com>
Sat, 20 Jun 2015 15:26:49 +0000 (17:26 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sat, 20 Jun 2015 15:26:49 +0000 (17:26 +0200)
wcfsetup/install/files/js/WoltLab/WCF/Date/Picker.js

index 1f2d8705eb6b3a938bdc5617b0baaa6ba543558c..96e57309d4ca18b80aaf898c2d1bc538b9d67734 100644 (file)
@@ -200,7 +200,7 @@ define(['DateUtil', 'Language', 'ObjectMap', 'DOM/ChangeListener', 'UI/Alignment
                        if (value) {
                                date = new Date(+value);
                                
-                               if (Number.isNaN(date.valueOf())) {
+                               if (date.toString() === 'Invalid Date') {
                                        date = new Date();
                                }
                        }