Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-60742

Calendar user time format preference override language strings

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.3.2, 3.4
    • Fix Version/s: 3.3.4, 3.4.1
    • Component/s: Calendar
    • Labels:
    • Testing Instructions:
      Hide
      1. Create an event in the calendar with duration
      2. View the upcoming events in the calendar (calendar/view.php)
      3. You should see your event time something like "Wednesday, 17 January, 2:00 AM » 3:00 AM"
      4. Change setting $CFG->calendar_site_timeformat to be 12 or 24h time format
      5. View event again and make sure the time is displayed correctly
      6. Change your user calendar preference to 12 or 24h time format (Click on your photo in top right corner, select preferences and Calendar preferences)
      7. View event again and make sure the time is displayed correctly
      8. Go to Site administration>Lanugage>Customisation , select your current language
      9. Choose langconfig.php and load strings. Customise language strings strftimetime12 and strftimetime24 by adding %Z to the end (this is a timezone). Do not modify strftimetime
      10. Try toggling user calendar preferences again and make sure the time is displayed in correct format with the timezone
      11. Set user calendar preferences to default and try toggling the system preferences - again make sure the time is displayed with the timezone
      12. Reset both user and system preferences to default and view calendar - there should be no timezone
      Show
      Create an event in the calendar with duration View the upcoming events in the calendar (calendar/view.php) You should see your event time something like "Wednesday, 17 January, 2:00 AM » 3:00 AM" Change setting $CFG->calendar_site_timeformat to be 12 or 24h time format View event again and make sure the time is displayed correctly Change your user calendar preference to 12 or 24h time format (Click on your photo in top right corner, select preferences and Calendar preferences) View event again and make sure the time is displayed correctly Go to Site administration>Lanugage>Customisation , select your current language Choose langconfig.php and load strings. Customise language strings strftimetime12 and strftimetime24 by adding %Z to the end (this is a timezone). Do not modify strftimetime Try toggling user calendar preferences again and make sure the time is displayed in correct format with the timezone Set user calendar preferences to default and try toggling the system preferences - again make sure the time is displayed with the timezone Reset both user and system preferences to default and view calendar - there should be no timezone
    • Affected Branches:
      MOODLE_33_STABLE, MOODLE_34_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE, MOODLE_34_STABLE
    • Pull 3.4 Branch:
      wip-MDL-60742-34
    • Pull Master Branch:
      wip-MDL-60742-master

      Description

      There are no language strings for 24 hour or 12 hour time preferences.  If you have adjusted your language strings to include time zone, for example, and a user changes their calendar view preference, the date/time format is hard coded into the code (calendar/lib.php) and does not reference any language string.

        Attachments

          Activity

            People

            • Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                15/Jan/18