@@ -637,9 +637,12 @@ if (!Number.prototype.map) {
637
637
//used immediately for the default value of options.isDST...
638
638
const highPrecisionTimestamp = performance . timeOrigin + performance . now ( ) ;
639
639
const sysDateObj = new Date ( highPrecisionTimestamp ) ;
640
- //TODO: if server timestamp is passed in and options.isDST is not, then options.isDST isn't any good...
641
- // no use using a client timestamps check for DST when a server timestamp is passed!
642
640
641
+ // If a server timestamp is passed in and options.isDST is not, then options.isDST isn't any good...
642
+ // It's no use using a client timestamp's check for DST when a server timestamp is passed!
643
+ // To fix this, we will give a console warning when a server timestamp is passed but isDST is not...
644
+ // In order to do that, we need to save a reference to the original isDST option before ensuring default options
645
+ const origDST = options . isDST || null ;
643
646
options = ensureDefaultOptions ( options , sysDateObj ) ;
644
647
options = normalizeOptions ( options ) ;
645
648
@@ -671,6 +674,9 @@ if (!Number.prototype.map) {
671
674
if ( options . timestamp !== "localsystime" ) {
672
675
if ( seemsToBePHPTimestamp ( options , sysDateObj ) ) {
673
676
options = normalizePHPTimestamp ( options , sysDateObj ) ;
677
+ if ( null === origDST ) {
678
+ console . warn ( 'jqClock: cannot automatically determine whether DST is in effect for a server side timestamp, please supply the `isDST` option' ) ;
679
+ }
674
680
}
675
681
else {
676
682
options . sysdiff = options . timestamp - sysDateObj . getTime ( ) ;
0 commit comments