Skip to content

Commit d31dde6

Browse files
committed
commit updates #1895
1 parent 4d4099a commit d31dde6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

grails-app/assets/javascripts/utils.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,12 @@ function convertToSimpleDate(isoDate, includeTime, showInUserTimeZone) {
9292

9393
var date;
9494
if (showInUserTimeZone === true) {
95-
var timezone = moment.tz.guess() || "Australia/Sydney";
96-
date = moment.tz(isoDate, timezone);
95+
// use the user’s local timezone
96+
date = moment(isoDate);
9797
}
9898
else {
99-
date = moment(isoDate);
99+
// keep the date in UTC to avoid shifting it for other viewers
100+
date = moment.utc(isoDate);
100101
}
101102

102103
var format = includeTime ? "DD-MM-YYYY HH:mm" : "DD-MM-YYYY";

0 commit comments

Comments
 (0)