From 0947a5be73136dc5e0f9f95343058196b816a5b8 Mon Sep 17 00:00:00 2001 From: Amin Arria Date: Tue, 3 Nov 2015 13:36:24 -0430 Subject: [PATCH 1/7] Ignorado sublime --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 911f7f45e9..e53ac08012 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,5 @@ coverage.html common/dist/scripts/* test/spec/mocks/translations.js + +*.sublime* \ No newline at end of file From 3f37da6f0410537c05d6fb3bc0526314d532ed60 Mon Sep 17 00:00:00 2001 From: Amin Arria Date: Thu, 12 Nov 2015 19:24:28 -0430 Subject: [PATCH 2/7] Created filter to convert timezone offset to UTC --- .../public/js/filters/timezoneOffsetToUtc.js | 18 ++++++++++++++++++ website/public/manifest.json | 1 + 2 files changed, 19 insertions(+) create mode 100644 website/public/js/filters/timezoneOffsetToUtc.js diff --git a/website/public/js/filters/timezoneOffsetToUtc.js b/website/public/js/filters/timezoneOffsetToUtc.js new file mode 100644 index 0000000000..25c95ea5a1 --- /dev/null +++ b/website/public/js/filters/timezoneOffsetToUtc.js @@ -0,0 +1,18 @@ +angular.module('habitrpg') + .filter('timezoneOffsetToUtc', function () { + return function (offset) { + if (offset > 0) { + var sign = '-'; + } else { + var sign = '+'; + } + + offset = Math.abs(offset) / 60; + + var hour = Math.floor(offset); + + var minutes = (offset - hour) * 60; + + return 'UTC' + sign + hour + ':' + minutes; + } + }); diff --git a/website/public/manifest.json b/website/public/manifest.json index 14ede37a12..4babf32792 100644 --- a/website/public/manifest.json +++ b/website/public/manifest.json @@ -57,6 +57,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", From 807726305fdf5be32081d3daea014b4930702acd Mon Sep 17 00:00:00 2001 From: Amin Arria Date: Thu, 12 Nov 2015 19:27:25 -0430 Subject: [PATCH 3/7] Added timezone form --- common/locales/en/settings.json | 5 ++++- website/views/options/settings.jade | 12 ++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/common/locales/en/settings.json b/common/locales/en/settings.json index 85926e2308..782fa70d50 100644 --- a/common/locales/en/settings.json +++ b/common/locales/en/settings.json @@ -140,5 +140,8 @@ "gemCapExtra": "Gem Cap Extra:", "mysticHourglasses": "Mystic Hourglasses:", "paypal": "PayPal", - "amazonPayments": "Amazon Payments" + "amazonPayments": "Amazon Payments", + "timezone": "Timezone", + "timezoneUTC": "Your timezone is: <%= utc %>", + "timezoneInfo": "
  • Habitica uses the timezone set on your PC / mobile device.
  • If you use two or more PCs / devices, the timezone sholid be the same on them all otherwise cron will be unpredictable.
  • The timezone displayed here is the one that Habitica currently believes is yours.
  • If that timezone is wrong, first reload the website to ensure that Habitica is reading the most recent timezone information from your PC. If it is still wrong, adjust the timezone on your PC.
" } diff --git a/website/views/options/settings.jade b/website/views/options/settings.jade index ebe96e9ae2..83d184d53e 100644 --- a/website/views/options/settings.jade +++ b/website/views/options/settings.jade @@ -105,6 +105,18 @@ 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 From 256bce1172b86074e6636e40a44c972b4b7b6812 Mon Sep 17 00:00:00 2001 From: Amin Arria Date: Fri, 13 Nov 2015 10:36:27 -0430 Subject: [PATCH 4/7] Revert "Ignorado sublime" This reverts commit 0947a5be73136dc5e0f9f95343058196b816a5b8. --- .gitignore | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitignore b/.gitignore index e53ac08012..911f7f45e9 100644 --- a/.gitignore +++ b/.gitignore @@ -29,5 +29,3 @@ coverage.html common/dist/scripts/* test/spec/mocks/translations.js - -*.sublime* \ No newline at end of file From 21dcafd964de7a26f1401578de97968539a81675 Mon Sep 17 00:00:00 2001 From: Amin Arria Date: Sun, 15 Nov 2015 22:59:58 -0430 Subject: [PATCH 5/7] Fixed missing 0 when minutes where less than 10 --- website/public/js/filters/timezoneOffsetToUtc.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/website/public/js/filters/timezoneOffsetToUtc.js b/website/public/js/filters/timezoneOffsetToUtc.js index 25c95ea5a1..1999efd0c3 100644 --- a/website/public/js/filters/timezoneOffsetToUtc.js +++ b/website/public/js/filters/timezoneOffsetToUtc.js @@ -1,17 +1,14 @@ angular.module('habitrpg') .filter('timezoneOffsetToUtc', function () { return function (offset) { - if (offset > 0) { - var sign = '-'; - } else { - var sign = '+'; - } + var sign = offset > 0 ? '-' : '+'; offset = Math.abs(offset) / 60; var hour = Math.floor(offset); - var minutes = (offset - hour) * 60; + var minutes_int = (offset - hour) * 60; + var minutes = minutes_int < 10 ? '0'+minutes_int : minutes_int; return 'UTC' + sign + hour + ':' + minutes; } From b87592c8a7886632bc93577c031cec91d5572b05 Mon Sep 17 00:00:00 2001 From: Amin Arria Date: Sun, 15 Nov 2015 23:00:44 -0430 Subject: [PATCH 6/7] Changed p blocks to single line --- website/views/options/settings.jade | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/website/views/options/settings.jade b/website/views/options/settings.jade index 83d184d53e..c42189e620 100644 --- a/website/views/options/settings.jade +++ b/website/views/options/settings.jade @@ -111,11 +111,9 @@ script(type='text/ng-template', id='partials/options.settings.settings.html') .form-horizontal .form-group .col-sm-12 - p - !=env.t('timezoneUTC', {utc: "{{ user.preferences.timezoneOffset | timezoneOffsetToUtc }}"}) + p!=env.t('timezoneUTC', {utc: "{{ user.preferences.timezoneOffset | timezoneOffsetToUtc }}"}) br - p - !=env.t('timezoneInfo') + p!=env.t('timezoneInfo') .personal-options.col-md-6 .panel.panel-default From 671d4aaecc01600ed133f675e60d7ff3b598c140 Mon Sep 17 00:00:00 2001 From: Amin Arria Date: Mon, 23 Nov 2015 11:38:26 -0430 Subject: [PATCH 7/7] Change timezone text --- common/locales/en/settings.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/locales/en/settings.json b/common/locales/en/settings.json index 782fa70d50..f5229d99bf 100644 --- a/common/locales/en/settings.json +++ b/common/locales/en/settings.json @@ -141,7 +141,7 @@ "mysticHourglasses": "Mystic Hourglasses:", "paypal": "PayPal", "amazonPayments": "Amazon Payments", - "timezone": "Timezone", - "timezoneUTC": "Your timezone is: <%= utc %>", - "timezoneInfo": "
  • Habitica uses the timezone set on your PC / mobile device.
  • If you use two or more PCs / devices, the timezone sholid be the same on them all otherwise cron will be unpredictable.
  • The timezone displayed here is the one that Habitica currently believes is yours.
  • If that timezone is wrong, first reload the website to ensure that Habitica is reading the most recent timezone information from your PC. If it is still wrong, adjust the timezone on your PC.
" + "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." }