Skip to content

Commit f1c350b

Browse files
committed
Merge branch 'master' of github.com:JohnRDOrazio/jQuery-Clock-Plugin
2 parents 454dbeb + 0f12e77 commit f1c350b

File tree

3 files changed

+37
-31
lines changed

3 files changed

+37
-31
lines changed

jqClock-lite.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -637,9 +637,12 @@ if (!Number.prototype.map) {
637637
//used immediately for the default value of options.isDST...
638638
const highPrecisionTimestamp = performance.timeOrigin + performance.now();
639639
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!
642640

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;
643646
options = ensureDefaultOptions( options, sysDateObj );
644647
options = normalizeOptions( options );
645648

@@ -671,6 +674,9 @@ if (!Number.prototype.map) {
671674
if (options.timestamp !== "localsystime") {
672675
if ( seemsToBePHPTimestamp( options, sysDateObj ) ) {
673676
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+
}
674680
}
675681
else {
676682
options.sysdiff = options.timestamp - sysDateObj.getTime();

jqClock-lite.min.js

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)