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

Timezone option not considered in dateselector and datetimeselector form element

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.9.12, 2.0
    • Fix Version/s: 2.3
    • Component/s: Forms Library
    • Labels:
    • Testing Instructions:
      Hide

      run php unit test for dateselector and datetimeselector

      phpunit dateselector_form_element_testcase lib/form/tests/dateselector_test.php
      phpunit datetimeselector_form_element_testcase lib/form/tests/datetimeselector_test.php

      Show
      run php unit test for dateselector and datetimeselector phpunit dateselector_form_element_testcase lib/form/tests/dateselector_test.php phpunit datetimeselector_form_element_testcase lib/form/tests/datetimeselector_test.php
    • Affected Branches:
      MOODLE_19_STABLE, MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull Master Branch:
      wip-mdl-27562

      Description

      /lib/form/dateselector.php doesn't pass configurable option 'timezone' to function usergetdate() as 2nd parameter.

      In function: onQuickFormEvent($event, $arg, &$caller)
      Change:
       
          if (!is_array($value)) {
              $currentdate = usergetdate($value);
              $value = array(
       
      To:
       
          if (!is_array($value)) {
              $currentdate = usergetdate($value, $this->_options['timezone']);
              $value = array(

        Attachments

        1. test.php
          0.8 kB
        2. test-dst.php
          1.0 kB

          Issue Links

            Activity

              People

              Assignee:
              rajeshtaneja Rajesh Taneja
              Reporter:
              brentb Brent Boghosian
              Peer reviewer:
              Jason Fowler
              Integrator:
              Sam Hemelryk
              Tester:
              Sam Hemelryk
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                25/Jun/12