Improve Date/Util.getTimeElement()
authorMatthias Schmidt <gravatronics@live.com>
Tue, 31 Oct 2017 14:41:46 +0000 (15:41 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Tue, 31 Oct 2017 14:41:46 +0000 (15:41 +0100)
See a16ab0f5037bf9f61e7c877d590abb8cdde4136c

wcfsetup/install/files/js/WoltLabSuite/Core/Date/Util.js

index 40be093072b058898956a05d7bf26d8dba39e5a0..49e246f1fe892b51bb4d79baadad7877687cb2ed 100644 (file)
@@ -233,15 +233,15 @@ define(['Language'], function(Language) {
                 */
                getTimeElement: function(date) {
                        var time = elCreate('time');
-                       time.classList = 'datetime';
+                       time.className = 'datetime';
                        
                        var formattedDate = this.formatDate(date);
                        var formattedTime = this.formatTime(date);
                        
                        elAttr(time, 'datetime', this.format(date, 'c'));
                        elData(time, 'timestamp', (date.getTime() - date.getMilliseconds()) / 1000);
-                       elData(time, 'date', this.formatDate(date));
-                       elData(time, 'time', this.formatTime(date));
+                       elData(time, 'date', formattedDate);
+                       elData(time, 'time', formattedTime);
                        elData(time, 'offset', date.getTimezoneOffset() * 60); // PHP returns minutes, JavaScript returns seconds
                        
                        if (date.getTime() > new Date().getTime()) {