diff --git a/common/locales/en/settings.json b/common/locales/en/settings.json index 714ccb0c30..c1d467aefd 100644 --- a/common/locales/en/settings.json +++ b/common/locales/en/settings.json @@ -144,5 +144,8 @@ "gemCapExtra": "Gem Cap Extra:", "mysticHourglasses": "Mystic Hourglasses:", "paypal": "PayPal", - "amazonPayments": "Amazon Payments" + "amazonPayments": "Amazon Payments", + "timezone": "Time Zone", + "timezoneUTC": "Habitica uses the time zone set on your PC, which is: <%= utc %>", + "timezoneInfo": "If that time zone is wrong, first reload this page using your browser's reload or refresh button to ensure that Habitica has the most recent information. If it is still wrong, adjust the time zone on your PC and then reload this page again.

If you use Habitica on other PCs or mobile devices, the time zone must be the same on them all. If your Dailies have been reseting at the wrong time, repeat this check on all other PCs and on a browser on your mobile devices." } diff --git a/website/public/js/filters/timezoneOffsetToUtc.js b/website/public/js/filters/timezoneOffsetToUtc.js new file mode 100644 index 0000000000..1999efd0c3 --- /dev/null +++ b/website/public/js/filters/timezoneOffsetToUtc.js @@ -0,0 +1,15 @@ +angular.module('habitrpg') + .filter('timezoneOffsetToUtc', function () { + return function (offset) { + var sign = offset > 0 ? '-' : '+'; + + offset = Math.abs(offset) / 60; + + var hour = Math.floor(offset); + + var minutes_int = (offset - hour) * 60; + var minutes = minutes_int < 10 ? '0'+minutes_int : minutes_int; + + return 'UTC' + sign + hour + ':' + minutes; + } + }); diff --git a/website/public/manifest.json b/website/public/manifest.json index 5a96670531..accb695df3 100644 --- a/website/public/manifest.json +++ b/website/public/manifest.json @@ -58,6 +58,7 @@ "js/filters/money.js", "js/filters/roundLargeNumbers.js", "js/filters/taskOrdering.js", + "js/filters/timezoneOffsetToUtc.js", "js/directives/close-menu.directive.js", "js/directives/expand-menu.directive.js", diff --git a/website/views/options/settings.jade b/website/views/options/settings.jade index 43e1c17608..2f27a2b719 100644 --- a/website/views/options/settings.jade +++ b/website/views/options/settings.jade @@ -116,6 +116,16 @@ script(type='text/ng-template', id='partials/options.settings.settings.html') ng-disabled='dayStart == user.preferences.dayStart') =env.t('saveCustomDayStart') + hr + + h5=env.t('timezone') + .form-horizontal + .form-group + .col-sm-12 + p!=env.t('timezoneUTC', {utc: "{{ user.preferences.timezoneOffset | timezoneOffsetToUtc }}"}) + br + p!=env.t('timezoneInfo') + .personal-options.col-md-6 .panel.panel-default .panel-heading