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

Include "All day" event in calendar

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 3.1, 3.1.1, 3.1.2
    • Calendar
    • MOODLE_31_STABLE
    • wip-MDL-56227-master
    • Hide

      Testing Instructions for MDL-56227

      Log in as admin or a user with rights to add/edit site events

      1. Create a new site event. Give it a start time and a duration. After saving, verify that it displays on upcoming events page correctly, showing both start and end times.
      2. Create a new site event. Give it a start time but no duration. After saving, verify that it displays on upcoming events page correctly, showing only start time but no end time.
      3. Create a new site event. Check the "All day" checkbox. Verify that the hours/minutes of the start time are disabled. Verify that all the "Duration" form elements group are also disabled. After saving, verify that it displays on upcoming events page correctly, showing the text "All day" and that it shows up above any other event that has a defined start time.
      4. Edit the "All day" event. Verify that the "All day" checkbox is checked by default and that the hours/minutes of the start time are disabled along with the "Duration" form elements group.
      5. Create a new site event. Check the "All day" checkbox as well as the "Repeated" checkbox and set the number of repeats to some value. Ensure that after saving, the event is repeated for the given number of days and that each of the repeated events are also shown as "All day"
      6. Create two new site events, one for November 6, 2016 and one for March 12, 2017 (end and beginning of daylight savings time), and mark them as "All day". After saving, verify that it displays on upcoming events page correctly, showing the text "All day" and that it shows up above any other event that has a defined start time.
      7. Repeat the steps above for a few more events with several on the same day to ensure that the "All day" events are indeed showing at the top of the page.

      Log in as teacher and enter course. In the course, repeat steps 1-6 above, but with course events. Also, do the following:

      1. Create a new assignment and have it start close to before midnight
      2. Create another new assignment and have it start close to after midnight
        (these are to test MDL-54607)

      As teacher in the course, export calendar and import it into a calendar application such as Outlook or iCal, or your mobile device's calendar and verify that all events imported correctly into the calendar application. This is used to verify MDL-54607 and MDL-52946.

      Testing Instructions for MDL-51853

      Login as admin or a user with permissions to manage calendar subcriptions

      1. Subscribe to an external calendar feed via "Managge subscriptions"
      2. Create an iCal file with a variety of event types (fixed duration, no duration, all day, span multiple days)
      3. Import this file via "Manage subscriptions" as well
      4. Verify that the events imported via the file are editable but the events imported via subscription are not
      Show
      Testing Instructions for MDL-56227 Log in as admin or a user with rights to add/edit site events Create a new site event. Give it a start time and a duration. After saving, verify that it displays on upcoming events page correctly, showing both start and end times. Create a new site event. Give it a start time but no duration. After saving, verify that it displays on upcoming events page correctly, showing only start time but no end time. Create a new site event. Check the "All day" checkbox. Verify that the hours/minutes of the start time are disabled. Verify that all the "Duration" form elements group are also disabled. After saving, verify that it displays on upcoming events page correctly, showing the text "All day" and that it shows up above any other event that has a defined start time. Edit the "All day" event. Verify that the "All day" checkbox is checked by default and that the hours/minutes of the start time are disabled along with the "Duration" form elements group. Create a new site event. Check the "All day" checkbox as well as the "Repeated" checkbox and set the number of repeats to some value. Ensure that after saving, the event is repeated for the given number of days and that each of the repeated events are also shown as "All day" Create two new site events, one for November 6, 2016 and one for March 12, 2017 (end and beginning of daylight savings time), and mark them as "All day". After saving, verify that it displays on upcoming events page correctly, showing the text "All day" and that it shows up above any other event that has a defined start time. Repeat the steps above for a few more events with several on the same day to ensure that the "All day" events are indeed showing at the top of the page. Log in as teacher and enter course. In the course, repeat steps 1-6 above, but with course events. Also, do the following: Create a new assignment and have it start close to before midnight Create another new assignment and have it start close to after midnight (these are to test MDL-54607 ) As teacher in the course, export calendar and import it into a calendar application such as Outlook or iCal, or your mobile device's calendar and verify that all events imported correctly into the calendar application. This is used to verify MDL-54607 and MDL-52946 . Testing Instructions for MDL-51853 Login as admin or a user with permissions to manage calendar subcriptions Subscribe to an external calendar feed via "Managge subscriptions" Create an iCal file with a variety of event types (fixed duration, no duration, all day, span multiple days) Import this file via "Manage subscriptions" as well Verify that the events imported via the file are editable but the events imported via subscription are not

      Currently, there is no complete, built in feature of an "All day" event. This causes a few issues:

      • For schools, there is no efficient way to include items like "Spring Break" or "End of First Semester"
      • Moodle's ambiguity regarding events with no duration cause issues with exports (See MDL-54607)

      Moodle actually has some provisions for the "All day" event, however it is incomplete. For example, in calendar/lib.php, around line 1700 (version 3.1) there is this set of lines:

               if ($usermidnightstart == $usermidnightend) {
                   // Check if we are running all day.
                  if ($event->timeduration == DAYSECS) {
                      $time = get_string('allday', 'calendar');
      

      The logic in this code is faulty because it will never get executed. If {{ $usermidnightstart == $usermidnightend }} then the start and end times must be on the same day. However, if the duration is {{ DAYSECS }} then the end date will always on the following day.

      What I propose is to define an "All day" event in Moodle as starting at Midnight and having exactly one minute less than the number of minutes in a full day so that the end time would be 11:59PM (23:59). Then, in displaying, exporting, and importing, a simple check to see if the start time is midnight and duration is also one minute less than a full day would then result in the proper display of the event as "All day".

            Unassigned Unassigned
            moodleboy Paul Prencis
            Adrian Greeve Adrian Greeve
            David Monllaó David Monllaó
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.