Skip to content

Commit 834d5f9

Browse files
authored
Merge pull request nightscout#4029 from DigitalDan1/dev
Fix daylight saving bug in profile editor
2 parents 9b238df + e930b1d commit 834d5f9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

static/profile/js/profileeditor.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -630,11 +630,11 @@
630630
}
631631

632632
function toTimeString(minfrommidnight) {
633-
return moment().startOf('day').add(minfrommidnight,'minutes').format('HH:mm');
633+
return moment.utc().startOf('day').add(minfrommidnight,'minutes').format('HH:mm'); // using utc to avoid daylight saving offset
634634
}
635635

636636
function toDisplayTime (minfrommidnight) {
637-
var time = moment().startOf('day').add(minfrommidnight,'minutes');
637+
var time = moment.utc().startOf('day').add(minfrommidnight,'minutes'); // using utc to avoid daylight saving offset
638638
return client.settings.timeFormat === 24 ? time.format('HH:mm') : time.format('h:mm A');
639639
}
640640

0 commit comments

Comments
 (0)