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

The default value of 'until' for new event in calendar is not suitable date and time.

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.6.2
    • Fix Version/s: None
    • Component/s: Calendar
    • Labels:
    • Affected Branches:
      MOODLE_26_STABLE

      Description

      The default value of "until" is set by moodle as Today and Now.

      Let you see calendar/event.php, Line 146;

      $event = new stdClass();
      $event->action = $action;
      $event->course = $courseid;
      $event->courseid = $courseid;
      $event->timeduration = 0;
      if ($formoptions->eventtypes->courses) {
      if (!$issite)

      { $event->eventtype = 'course'; }

      else

      { unset($formoptions->eventtypes->courses); unset($formoptions->eventtypes->groups); }

      }
      $event->timestart = $time;
      // (Shirai022): add next one line
      $event->timedurationuntil = $time + 60*60*23+60*25;
      // (Shirai022): add above one line
      $event = new calendar_event($event);

      In original source code, $event->timedurationuntil is not set any value. I guess that if no value is set for $timedurationuntil then default value of $timedurationuntil = time() at/by input form codes.

      It is suitable default value that Default time of start date is 00:00 and default time of end date is 23:55, since the duration data '00:00-23:55' corresponds with the whole day event.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              shirai Tatsuya Shirai
              Participants:
              Component watchers:
              Andrew Nicols, Mathew May, Michael Hawkins, Shamim Rezaie, Simey Lameze
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: