File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed
app/code/Magento/Backend/view/adminhtml/templates/page/js Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ require([
50
50
showTime: false,
51
51
showHour: false,
52
52
showMinute: false,
53
- serverTimezoneOffset : <?php echo (int ) $ block ->getTimezoneOffsetSeconds (); ?> ,
53
+ serverTimezoneSeconds : <?php echo (int ) $ block ->getStoreTimestamp (); ?> ,
54
54
yearRange: '<?php /* @escapeNotVerified */ echo $ block ->getYearRange () ?> '
55
55
}
56
56
});
Original file line number Diff line number Diff line change 323
323
// Get local time in ms
324
324
var ms = Date . now ( ) ;
325
325
326
- // Adjust milliseconds according to store timezone offset
327
- // Mind the GMT zero offset
328
- if ( typeof this . options . serverTimezoneOffset !== 'undefined' ) {
329
- // Make UTC time and add store timezone offset in seconds
330
- ms += ( new Date ( ) . getTimezoneOffset ( ) * 60 * 1000 ) + this . options . serverTimezoneOffset * 1000 ;
326
+ // Use store timestamp based on store timezone settings
327
+ if ( typeof this . options . serverTimezoneSeconds !== 'undefined' ) {
328
+ //Adjust milliseconds according to client local timezone offset
329
+ ms = ( this . options . serverTimezoneSeconds + new Date ( ) . getTimezoneOffset ( ) * 60 ) * 1000 ;
331
330
}
332
331
333
332
return new Date ( ms ) ;
You can’t perform that action at this time.
0 commit comments