Uploaded image for project: 'LAMS Development'
  1. LAMS Development
  2. LDEV-2531

Decouple timezones from geographic location

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.3.4
    • Fix Version/s: 2.4, 2.3.5
    • Component/s: Admin, General
    • Labels:
      None

      Description

      As we have tied the location to a timezone, unfortunately, we haven't taken into account the "day light saving" options. So for example the timezone for Sydney in LAMS says "GMT+10 Eastern Australia, Guam, Vladivostock", when in reality, now (when I created this task) we have day light savings, we are in GMT+11!

      So I think we need to decouple geographic location and timezone completely. So we will have an option to choose your timezone based on GMT + or - 13 hours (increments in .5 hr so -13, -12.5, -12,..... to +13) and another separate option for country (list of countries on a dropdown menu) and city instead (textfield).

        Activity

        Hide
        dronych Andrey Balan added a comment -
        bq. and another separate option for country (list of countries on a dropdown menu) and city instead (textfield).

        We already have fields "City"(textfield) and "Country"(textfield) on user's profile page.
        Thus I should only change "Country" field into list of countries on a dropdown menu?
        and I'm going to use this list of countries http://www.iso.org/iso/english_country_names_and_code_elements
        Show
        dronych Andrey Balan added a comment - bq. and another separate option for country (list of countries on a dropdown menu) and city instead (textfield). We already have fields "City"(textfield) and "Country"(textfield) on user's profile page. Thus I should only change "Country" field into list of countries on a dropdown menu? and I'm going to use this list of countries http://www.iso.org/iso/english_country_names_and_code_elements
        Hide
        ernieg Ernie Ghiglione added a comment -
        Yes, Andrey, let's go with that list. Please use the ISO codes as well. Thanks
        Show
        ernieg Ernie Ghiglione added a comment - Yes, Andrey, let's go with that list. Please use the ISO codes as well. Thanks
        Hide
        dronych Andrey Balan added a comment -
        there is a way how to handle "daylight savings" problem.

        I was looking at the JavaDoc for TimeZone class and found such a phrase: "No daylight saving time transition schedule can be specified with a custom time zone ID."
        which means that there are some IDs that support transition schedule.
        list of all available Ids
        http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/com.ibm.websphere.express.doc/info/exp/ae/rrun_svr_timezones.html

        so I decided to postpone for a while with separating timezones from geographic locations.
        and just try to fix model that we already have.

        the result of this is the modified list of timezones:
        label.timezone.0 =(GMT -12:00) Eniwetok, Kwajalein
        label.timezone.1 =(GMT -11:00) Midway Island, Samoa
        label.timezone.2 =(GMT -10:00) Hawaii
        label.timezone.3 =(GMT -9:00 *Daylight Saving Time) Alaska
        label.timezone.4 =(GMT -8:00 *Daylight Saving Time) Pacific Time (US & Canada)
        label.timezone.5 =(GMT -8:00) Pacific Time (US & Canada)
        label.timezone.6 =(GMT -7:00 *Daylight Saving Time) Mountain Time (US & Canada)
        label.timezone.7 =(GMT -7:00) Mountain Time (US & Canada)
        label.timezone.8 =(GMT -6:00 *Daylight Saving Time) Central Time (US & Canada)
        label.timezone.9 =(GMT -6:00) Central Time (US & Canada)
        label.timezone.10 =(GMT -6:00 *Daylight Saving Time) Mexico City
        label.timezone.11 =(GMT -5:00 *Daylight Saving Time) Eastern Time (US & Canada)
        label.timezone.12 =(GMT -5:00) Eastern Time (US & Canada) , Bogota, Lima
        label.timezone.13 =(GMT -4:00 *Daylight Saving Time) Atlantic Time (Canada)
        label.timezone.14 =(GMT -4:00) Atlantic Time (Canada), Caracas, La Paz
        label.timezone.15 =(GMT -3:30 *Daylight Saving Time) Newfoundland
        label.timezone.16 =(GMT -3:00 *Daylight Saving Time) Brazil
        label.timezone.17 =(GMT -3:00) Brazil, Buenos Aires, Georgetown
        label.timezone.18 =(GMT -2:00) Mid-Atlantic
        label.timezone.19 =(GMT -1:00 hour *Daylight Saving Time) Azores
        label.timezone.20 =(GMT -1:00 hour) Cape Verde Islands
        label.timezone.21 =(GMT *Daylight Saving Time) Western Europe Time, London, Lisbon, Casablanca
        label.timezone.22 =(GMT) Greenwich Mean Time, Casablanca
        label.timezone.23 =(GMT +1:00 hour *Daylight Saving Time) Brussels, Copenhagen, Madrid, Paris
        label.timezone.24 =(GMT +1:00 hour) Western African Time
        label.timezone.25 =(GMT +2:00 *Daylight Saving Time) Athens, Istanbul, Kaliningrad
        label.timezone.26 =(GMT +2:00) Central African Time
        label.timezone.27 =(GMT +3:00 *Daylight Saving Time) Baghdad, Moscow, St. Petersburg
        label.timezone.28 =(GMT +3:00) Qatar, Riyadh
        label.timezone.29 =(GMT +3:30 *Daylight Saving Time) Tehran
        label.timezone.30 =(GMT +4:00 *Daylight Saving Time) Baku, Tbilisi
        label.timezone.31 =(GMT +4:00) Abu Dhabi, Muscat
        label.timezone.32 =(GMT +4:30) Kabul
        label.timezone.33 =(GMT +5:00 *Daylight Saving Time) Ekaterinburg
        label.timezone.34 =(GMT +5:00) Karachi, Tashkent
        label.timezone.35 =(GMT +5:30) Bombay, Calcutta, Madras, New Delhi
        label.timezone.36 =(GMT +5:45) Kathmandu
        label.timezone.37 =(GMT +6:00 *Daylight Saving Time) Almaty, Novosibirsk
        label.timezone.38 =(GMT +6:00) Dhaka, Colombo
        label.timezone.39 =(GMT +7:00 *Daylight Saving Time) Krasnoyarsk
        label.timezone.40 =(GMT +7:00) Bangkok, Hanoi, Jakarta
        label.timezone.41 =(GMT +8:00 *Daylight Saving Time) Irkutsk
        label.timezone.42 =(GMT +8:00) Beijing, Perth, Singapore, Hong Kong
        label.timezone.43 =(GMT +9:00 *Daylight Saving Time) Yakutsk
        label.timezone.44 =(GMT +9:00) Tokyo, Seoul, Osaka, Sapporo
        label.timezone.45 =(GMT +9:30 *Daylight Saving Time) Adelaide
        label.timezone.46 =(GMT +9:30) Darwin
        label.timezone.47 =(GMT +10:00 *Daylight Saving Time) Eastern Australia
        label.timezone.48 =(GMT +10:00 *Daylight Saving Time) Vladivostok
        label.timezone.49 =(GMT +10:00) Brisbane, Guam
        label.timezone.50 =(GMT +11:00 *Daylight Saving Time) Magadan
        label.timezone.51 =(GMT +11:00) Solomon Islands, New Caledonia
        label.timezone.52 =(GMT +12:00 *Daylight Saving Time) Auckland, Wellington
        label.timezone.53 =(GMT +12:00 *Daylight Saving Time) Kamchatka
        label.timezone.54 =(GMT +12:00) Fiji

        some of them support Daylight Saving Time (and they're marked with "*Daylight Saving Time")
        all the rest do not support (as they don't observe DST)


        for example:
        previously there was a timezone called Mountain Time (US & Canada).
        and in most states in the USA and in most provinces in Canada, Daylight-Saving Time (DST) is observed.

        accordingly we have a zone -
        label.timezone.6 =(GMT -7:00 *Daylight Saving Time) Mountain Time (US & Canada)
        and another one without Daylight Saving Time -
        label.timezone.7 =(GMT -7:00) Mountain Time (US & Canada)


        the titles can be changed though.
        i.e. instead of "(GMT -7:00 *Daylight Saving Time) Mountain Time (US & Canada)" - we can put several cities from Mountain Time that observe DST.
        Show
        dronych Andrey Balan added a comment - there is a way how to handle "daylight savings" problem. I was looking at the JavaDoc for TimeZone class and found such a phrase: "No daylight saving time transition schedule can be specified with a custom time zone ID." which means that there are some IDs that support transition schedule. list of all available Ids http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/com.ibm.websphere.express.doc/info/exp/ae/rrun_svr_timezones.html so I decided to postpone for a while with separating timezones from geographic locations. and just try to fix model that we already have. the result of this is the modified list of timezones: label.timezone.0 =(GMT -12:00) Eniwetok, Kwajalein label.timezone.1 =(GMT -11:00) Midway Island, Samoa label.timezone.2 =(GMT -10:00) Hawaii label.timezone.3 =(GMT -9:00 *Daylight Saving Time) Alaska label.timezone.4 =(GMT -8:00 *Daylight Saving Time) Pacific Time (US & Canada) label.timezone.5 =(GMT -8:00) Pacific Time (US & Canada) label.timezone.6 =(GMT -7:00 *Daylight Saving Time) Mountain Time (US & Canada) label.timezone.7 =(GMT -7:00) Mountain Time (US & Canada) label.timezone.8 =(GMT -6:00 *Daylight Saving Time) Central Time (US & Canada) label.timezone.9 =(GMT -6:00) Central Time (US & Canada) label.timezone.10 =(GMT -6:00 *Daylight Saving Time) Mexico City label.timezone.11 =(GMT -5:00 *Daylight Saving Time) Eastern Time (US & Canada) label.timezone.12 =(GMT -5:00) Eastern Time (US & Canada) , Bogota, Lima label.timezone.13 =(GMT -4:00 *Daylight Saving Time) Atlantic Time (Canada) label.timezone.14 =(GMT -4:00) Atlantic Time (Canada), Caracas, La Paz label.timezone.15 =(GMT -3:30 *Daylight Saving Time) Newfoundland label.timezone.16 =(GMT -3:00 *Daylight Saving Time) Brazil label.timezone.17 =(GMT -3:00) Brazil, Buenos Aires, Georgetown label.timezone.18 =(GMT -2:00) Mid-Atlantic label.timezone.19 =(GMT -1:00 hour *Daylight Saving Time) Azores label.timezone.20 =(GMT -1:00 hour) Cape Verde Islands label.timezone.21 =(GMT *Daylight Saving Time) Western Europe Time, London, Lisbon, Casablanca label.timezone.22 =(GMT) Greenwich Mean Time, Casablanca label.timezone.23 =(GMT +1:00 hour *Daylight Saving Time) Brussels, Copenhagen, Madrid, Paris label.timezone.24 =(GMT +1:00 hour) Western African Time label.timezone.25 =(GMT +2:00 *Daylight Saving Time) Athens, Istanbul, Kaliningrad label.timezone.26 =(GMT +2:00) Central African Time label.timezone.27 =(GMT +3:00 *Daylight Saving Time) Baghdad, Moscow, St. Petersburg label.timezone.28 =(GMT +3:00) Qatar, Riyadh label.timezone.29 =(GMT +3:30 *Daylight Saving Time) Tehran label.timezone.30 =(GMT +4:00 *Daylight Saving Time) Baku, Tbilisi label.timezone.31 =(GMT +4:00) Abu Dhabi, Muscat label.timezone.32 =(GMT +4:30) Kabul label.timezone.33 =(GMT +5:00 *Daylight Saving Time) Ekaterinburg label.timezone.34 =(GMT +5:00) Karachi, Tashkent label.timezone.35 =(GMT +5:30) Bombay, Calcutta, Madras, New Delhi label.timezone.36 =(GMT +5:45) Kathmandu label.timezone.37 =(GMT +6:00 *Daylight Saving Time) Almaty, Novosibirsk label.timezone.38 =(GMT +6:00) Dhaka, Colombo label.timezone.39 =(GMT +7:00 *Daylight Saving Time) Krasnoyarsk label.timezone.40 =(GMT +7:00) Bangkok, Hanoi, Jakarta label.timezone.41 =(GMT +8:00 *Daylight Saving Time) Irkutsk label.timezone.42 =(GMT +8:00) Beijing, Perth, Singapore, Hong Kong label.timezone.43 =(GMT +9:00 *Daylight Saving Time) Yakutsk label.timezone.44 =(GMT +9:00) Tokyo, Seoul, Osaka, Sapporo label.timezone.45 =(GMT +9:30 *Daylight Saving Time) Adelaide label.timezone.46 =(GMT +9:30) Darwin label.timezone.47 =(GMT +10:00 *Daylight Saving Time) Eastern Australia label.timezone.48 =(GMT +10:00 *Daylight Saving Time) Vladivostok label.timezone.49 =(GMT +10:00) Brisbane, Guam label.timezone.50 =(GMT +11:00 *Daylight Saving Time) Magadan label.timezone.51 =(GMT +11:00) Solomon Islands, New Caledonia label.timezone.52 =(GMT +12:00 *Daylight Saving Time) Auckland, Wellington label.timezone.53 =(GMT +12:00 *Daylight Saving Time) Kamchatka label.timezone.54 =(GMT +12:00) Fiji some of them support Daylight Saving Time (and they're marked with "*Daylight Saving Time") all the rest do not support (as they don't observe DST) for example: previously there was a timezone called Mountain Time (US & Canada). and in most states in the USA and in most provinces in Canada, Daylight-Saving Time (DST) is observed. accordingly we have a zone - label.timezone.6 =(GMT -7:00 *Daylight Saving Time) Mountain Time (US & Canada) and another one without Daylight Saving Time - label.timezone.7 =(GMT -7:00) Mountain Time (US & Canada) the titles can be changed though. i.e. instead of "(GMT -7:00 *Daylight Saving Time) Mountain Time (US & Canada)" - we can put several cities from Mountain Time that observe DST.
        Hide
        ernieg Ernie Ghiglione added a comment -
        Ok, I think I've got it... so if you are to specify a timezone for the TimeZone class, it would have to have a corresponding custom time zone ID, right? So that means that we can't have GMT -8.5 timezone if it doesn't exists, correct?

        The only catch I see with this is that some timezone do change every now and then. For instance, last november when I was in Buenos AIres, the Argentine government decided not to use daylight savings at all. ("Argentina determines whether to observe daylight saving time on a year-by-year basis, and individual provinces may opt out of the federal decision." http://en.wikipedia.org/wiki/Time_in_Argentina).

        The list of timezones is quite large (almost 400+ locations) http://goo.gl/Cvcx

        In order to update the timezones regularly for java, it seems that there's a tool that can do this: http://goo.gl/gySy

        Also note that our current timezones go from -12 to +12, which means that a place like Tonga (Jun-Dir's soon to be home) wouldn't have a timezone GMT +13. Note that there's another location that is GMT +14 too (Pacific/Kiritimati).


        Show
        ernieg Ernie Ghiglione added a comment - Ok, I think I've got it... so if you are to specify a timezone for the TimeZone class, it would have to have a corresponding custom time zone ID, right? So that means that we can't have GMT -8.5 timezone if it doesn't exists, correct? The only catch I see with this is that some timezone do change every now and then. For instance, last november when I was in Buenos AIres, the Argentine government decided not to use daylight savings at all. ("Argentina determines whether to observe daylight saving time on a year-by-year basis, and individual provinces may opt out of the federal decision." http://en.wikipedia.org/wiki/Time_in_Argentina) . The list of timezones is quite large (almost 400+ locations) http://goo.gl/Cvcx In order to update the timezones regularly for java, it seems that there's a tool that can do this: http://goo.gl/gySy Also note that our current timezones go from -12 to +12, which means that a place like Tonga (Jun-Dir's soon to be home) wouldn't have a timezone GMT +13. Note that there's another location that is GMT +14 too (Pacific/Kiritimati).
        Hide
        dronych Andrey Balan added a comment -
        we have an error in CloudWizard now.
        so "Scheduling" bits works wrong sometimes, throwing the following exception:
        TypeError: Error #1009: Cannot access a property or method of a null object reference
        at org.lamsfoundation.lams.validators::LessonValidator/validateScheduleDate()
        at org.lamsfoundation.lams.validators::LessonValidator/doValidation()
        at mx.validators::Validator/processValidation()
        at mx.validators::Validator/validate()
        at org.lamsfoundation.lams.views::Advanced/hasFocus()
        at org.lamsfoundation.lams.views::Advanced/___Advanced_Listener1_receive()
        at flash.events::EventDispatcher/dispatchEventFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at mx.core::UIComponent/dispatchEvent()
        at org.lamsfoundation.lams.views::Wizard/tabChange()

        it happens if you have choosen any timezone after "(GMT +4:00 *Daylight Saving Time) Baku, Tbilisi" in user profile.

        the reason: Flex shows only 31 timezones, instead of showing 57 currently available ones.
        Also all these 57 are being sent to Flash
        http://lamscvs.melcoe.mq.edu.au:8060/fisheye/browse/lams/lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringAction.java?r=1.66 (line 773)
        Show
        dronych Andrey Balan added a comment - we have an error in CloudWizard now. so "Scheduling" bits works wrong sometimes, throwing the following exception: TypeError: Error #1009: Cannot access a property or method of a null object reference at org.lamsfoundation.lams.validators::LessonValidator/validateScheduleDate() at org.lamsfoundation.lams.validators::LessonValidator/doValidation() at mx.validators::Validator/processValidation() at mx.validators::Validator/validate() at org.lamsfoundation.lams.views::Advanced/hasFocus() at org.lamsfoundation.lams.views::Advanced/___Advanced_Listener1_receive() at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.core::UIComponent/dispatchEvent() at org.lamsfoundation.lams.views::Wizard/tabChange() it happens if you have choosen any timezone after "(GMT +4:00 *Daylight Saving Time) Baku, Tbilisi" in user profile. the reason: Flex shows only 31 timezones, instead of showing 57 currently available ones. Also all these 57 are being sent to Flash http://lamscvs.melcoe.mq.edu.au:8060/fisheye/browse/lams/lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringAction.java?r=1.66 (line 773)
        Hide
        ernieg Ernie Ghiglione added a comment -
        Show
        ernieg Ernie Ghiglione added a comment - See LDEV-2544
        Hide
        ernieg Ernie Ghiglione added a comment -
        No longer required as LDEV-2544 is now in place
        Show
        ernieg Ernie Ghiglione added a comment - No longer required as LDEV-2544 is now in place
        Hide
        ernieg Ernie Ghiglione added a comment -
        Reopen as the status in JIRA shows as resolved instead of Close... re-closing in just a sec
        Show
        ernieg Ernie Ghiglione added a comment - Reopen as the status in JIRA shows as resolved instead of Close... re-closing in just a sec

          People

          • Assignee:
            ernieg Ernie Ghiglione
            Reporter:
            ernieg Ernie Ghiglione
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development