Merge pull request #6228 from AminArria/timezone-information

Timezone information
This commit is contained in:
Alys 2015-11-24 21:21:10 +10:00
commit e04066e45f
4 changed files with 30 additions and 1 deletions

View file

@ -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: <strong><%= utc %></strong>",
"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.<br><br> <strong>If you use Habitica on other PCs or mobile devices, the time zone must be the same on them all.</strong> 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."
}

View file

@ -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;
}
});

View file

@ -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",

View file

@ -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