Moodle
  1. Moodle
  2. MDL-42587

Date picker now lets you pick invalid dates

    Details

    • Rank:
      54414

      Description

      When selecting a date in a date picker, the old behaviour where the popup calendar would appear prevented you from picking invalid dates (i.e. 31st of September) as the popup calendar would automatically correct the pull-downs (to 1st of October in this example).

        Issue Links

          Activity

          Hide
          Michael de Raadt added a comment -

          Thanks for spotting that and providing a patch.

          I wonder if it is more logical to simply force the last date of the selected month?

          Show
          Michael de Raadt added a comment - Thanks for spotting that and providing a patch. I wonder if it is more logical to simply force the last date of the selected month?
          Hide
          Adam Olley added a comment -

          I just made the patch to get the behaviour to match how it used to be. I think either way is fine. As for whats more logical I'll leave for someone else to decide

          Show
          Adam Olley added a comment - I just made the patch to get the behaviour to match how it used to be. I think either way is fine. As for whats more logical I'll leave for someone else to decide
          Hide
          Michael de Raadt added a comment -

          Thanks, Adam.

          If that's the old behaviour, then it's probably best to continue it.

          Show
          Michael de Raadt added a comment - Thanks, Adam. If that's the old behaviour, then it's probably best to continue it.
          Hide
          Adrian Greeve added a comment -

          [Y] Syntax
          [Y] Whitespace
          [Y] Output
          [-] Language
          [-] Databases
          [Y] Testing (instructions and automated tests)
          [-] Security
          [-] Documentation
          [Y] Git
          [-] Third party code
          [Y] Sanity check

          Hello Adam,

          I think that the code looks good.
          I'm inclined to leave the logic as it is with the month being incremented when the date is invalid.
          Feel free to submit for integration when ready.

          Thanks.

          Show
          Adrian Greeve added a comment - [Y] Syntax [Y] Whitespace [Y] Output [-] Language [-] Databases [Y] Testing (instructions and automated tests) [-] Security [-] Documentation [Y] Git [-] Third party code [Y] Sanity check Hello Adam, I think that the code looks good. I'm inclined to leave the logic as it is with the month being incremented when the date is invalid. Feel free to submit for integration when ready. Thanks.
          Hide
          Adam Olley added a comment -

          As can be seen from my stumbling through JIRA states, I mistakenly thought I'd be able to submit for integration somewhere. I think the peer reviewer needs to be the one to submit for integration?

          Show
          Adam Olley added a comment - As can be seen from my stumbling through JIRA states, I mistakenly thought I'd be able to submit for integration somewhere. I think the peer reviewer needs to be the one to submit for integration?
          Hide
          Adrian Greeve added a comment -

          Sorry about that. It's hard to know who can submit straight to integration review and who can't.

          Show
          Adrian Greeve added a comment - Sorry about that. It's hard to know who can submit straight to integration review and who can't.
          Hide
          Marina Glancy added a comment -

          Thanks Adam, integrated in 2.5 and 2.6

          I also personally think that last day of month would be more logical but I confirm that 2.4 also jumps to 3/03 when I select 31/2

          Show
          Marina Glancy added a comment - Thanks Adam, integrated in 2.5 and 2.6 I also personally think that last day of month would be more logical but I confirm that 2.4 also jumps to 3/03 when I select 31/2
          Hide
          Rossiani Wijaya added a comment -

          This is working as expected.

          Tested for 2.5 and master.

          Test passed.

          Show
          Rossiani Wijaya added a comment - This is working as expected. Tested for 2.5 and master. Test passed.
          Hide
          Dan Poltawski added a comment -

          Congratulations - this issue has been included in Moodle and is now available on our git mirrors and shortly will become available on the download servers shortly.

          Show
          Dan Poltawski added a comment - Congratulations - this issue has been included in Moodle and is now available on our git mirrors and shortly will become available on the download servers shortly.

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: