FIX: Invalid Date on "last" shortcut for timer + bookmarks (PR #12783)

The “last custom date and time” shortcut for the topic timer and bookmarks could get into a state where it had an Invalid Date if the user opened the topic timer modal, clicked Custom Date and then closed the modal without making changes. This has been fixed, the last custom date + time will no longer be set in this case and if somehow the last custom date + time is invalid that option will not show.

Also improve the wording from just “Last” to “Last custom datetime”


What do you think about changing order here? First ensure that new parsed value is valid and then compare it with current time

sorry very much nitpicking here, but I don’t know why sometimes you add linebreak between browser actions and sometimes not :stuck_out_tongue:

I like to keep you on your toes @jjaffeux :stuck_out_tongue:

In seriousness after reviewing these, it is because it is grouped in my head to similar states; the group you highlighted for example is 1. visiting the page and opening the topic timer modal. The next block of actions is 2. click on custom date and time and press save.

End of nitpick after this, don’t want to waste your time.

Basically I think it’s more readable to just do:

  • setup linebreak
  • steps linebreak
  • assertion

Anything else will be subject to interpretation IMO. This being said I don’t mind with what you did.

This pull request has been mentioned on Discourse Meta. There might be relevant details there: