Moodle
  1. Moodle
  2. MDL-16592

Date Picker Formslib element, show a pop-up calendar for picking dates

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.2
    • Fix Version/s: 2.0
    • Component/s: Forms Library
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE
    • Rank:
      35563

      Description

      I believe that with the integration of some nice date picker such as dojo, mootools,etc. moodle´s formslib would increase it Accessibility to the user. Wouldn´t it make moodle more user friendly? This integration should be done beetween Pear library and an appropriate date picker.

        Issue Links

          Activity

          Hide
          Tim Hunt added a comment -

          I have committed most of this, just one small remaining issue that I know about, to do with using the keyboard to select a date.

          Get keyboard focus onto the 'previous month' arrow. Then press SHIFT + TAB. This takes you outside this date element, so the calendar should disappear, but it does not.

          Does anyone have any idea how to solve this.

          The opposite case when you tab forwards off the last part of the date selector works fine.

          Show
          Tim Hunt added a comment - I have committed most of this, just one small remaining issue that I know about, to do with using the keyboard to select a date. Get keyboard focus onto the 'previous month' arrow. Then press SHIFT + TAB. This takes you outside this date element, so the calendar should disappear, but it does not. Does anyone have any idea how to solve this. The opposite case when you tab forwards off the last part of the date selector works fine.
          Hide
          Tim Hunt added a comment -

          Oops, there is another issue I need to fix.

          With the calendar not visible. and with a form element that includes both dates and times, if you click on the time dropdown, the calendar appears, which is intentional, but the dropdown menu does not expand, which is bad.

          Show
          Tim Hunt added a comment - Oops, there is another issue I need to fix. With the calendar not visible. and with a form element that includes both dates and times, if you click on the time dropdown, the calendar appears, which is intentional, but the dropdown menu does not expand, which is bad.
          Hide
          Matt Gibson added a comment -

          Hi Tim,

          this sounds great and I was about to test it, but my CVS 2.0 test site doesn't seem to have it (tested adding online text assignment). Is it working only on some bits or did you revert the commits?

          Show
          Matt Gibson added a comment - Hi Tim, this sounds great and I was about to test it, but my CVS 2.0 test site doesn't seem to have it (tested adding online text assignment). Is it working only on some bits or did you revert the commits?
          Hide
          Tim Hunt added a comment -

          What I did changes the existing date and date_time form element types. They look the same as ever until you click on them, and then the calendar pops up.

          Show
          Tim Hunt added a comment - What I did changes the existing date and date_time form element types. They look the same as ever until you click on them, and then the calendar pops up.
          Hide
          Matt Gibson added a comment -

          D'oh! Why didn't I click on them? I've tried it now and it works really well. I have some thoughts on extra features that would make this even better (of course )

          One thing I expected though was for double click on the date to both set it and close the pop up, which it didn't.

          Just to save a click, would it be possible to have a two month pop-up instead of just one? The example below would make it a lot easier to set longer deadlines, which is going to be relatively often as with a two week assignment, 50% of the time the deadline will be next month.

          http://developer.yahoo.com/yui/examples/calendar/calgrp.html

          I also noticed that it is possible to select dates that are in the past. I can't think of many times when that would be necessary (maybe to adjust a previous deadline after a mistake?) but it will normally be an error I think, so a warning/confirmation may be appropriate in this case when the calendar loses focus. What do you think?

          Related to this, it would be good to make it impossible to select dates outside of the course start and end dates as per this example: http://developer.yahoo.com/yui/examples/calendar/minmax.html

          Thanks for fixing this - it's been bugging me for ages!

          Show
          Matt Gibson added a comment - D'oh! Why didn't I click on them? I've tried it now and it works really well. I have some thoughts on extra features that would make this even better (of course ) One thing I expected though was for double click on the date to both set it and close the pop up, which it didn't. Just to save a click, would it be possible to have a two month pop-up instead of just one? The example below would make it a lot easier to set longer deadlines, which is going to be relatively often as with a two week assignment, 50% of the time the deadline will be next month. http://developer.yahoo.com/yui/examples/calendar/calgrp.html I also noticed that it is possible to select dates that are in the past. I can't think of many times when that would be necessary (maybe to adjust a previous deadline after a mistake?) but it will normally be an error I think, so a warning/confirmation may be appropriate in this case when the calendar loses focus. What do you think? Related to this, it would be good to make it impossible to select dates outside of the course start and end dates as per this example: http://developer.yahoo.com/yui/examples/calendar/minmax.html Thanks for fixing this - it's been bugging me for ages!
          Hide
          Tim Hunt added a comment -

          As far as I am concerned, those are all separate feature requests that I am not going to do. (They are all quite possible, but I don't have the time.)

          It currently does enforce minimum and maximum date in the same way that the dropdown menus do (there is a startyear and stopyear setting).

          Of course, we should not force teachers to set dates inside the start and end dates. There may be good reasons to allow it. The correct solution is, of course, to show all the other course events in the calendar pop-up (including start and end date) to help the user choose. I am absolutely not volunteering to do that, it would be a lot of work.

          Show
          Tim Hunt added a comment - As far as I am concerned, those are all separate feature requests that I am not going to do. (They are all quite possible, but I don't have the time.) It currently does enforce minimum and maximum date in the same way that the dropdown menus do (there is a startyear and stopyear setting). Of course, we should not force teachers to set dates inside the start and end dates. There may be good reasons to allow it. The correct solution is, of course, to show all the other course events in the calendar pop-up (including start and end date) to help the user choose. I am absolutely not volunteering to do that, it would be a lot of work.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: