Page MenuHomePhabricator

Saturate day of month in datepicker
ClosedPublic

Authored by 0 on Jun 13 2021, 9:16 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 4 2024, 1:02 AM
Unknown Object (File)
Jan 6 2024, 6:47 PM
Unknown Object (File)
Jan 3 2024, 7:45 PM
Unknown Object (File)
Dec 30 2023, 6:28 PM
Unknown Object (File)
Dec 28 2023, 8:53 PM
Unknown Object (File)
Dec 26 2023, 7:54 PM
Unknown Object (File)
Dec 24 2023, 12:24 AM
Unknown Object (File)
Nov 29 2023, 11:15 PM
Subscribers

Details

Summary

The datepicker could step by the wrong number of months, due to the date rolling over to the next month when the number of days in the month is exceeded. For example, going forward from January 31 would jump to March 3, while going backward from July 31 would only go to July 1.

Push the date back to ensure that the datepicker stays in the correct month when switching.

Test Plan

Changed months starting from an assortment of dates.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

0 held this revision as a draft.
0 published this revision for review.Jun 13 2021, 9:22 PM

Wondering if you saw:

Effective June 1, 2021: Phabricator is no longer actively maintained.

I did see that, but @epriestley (or possibly an impostor) said:

I think a reasonable strategy for the moment is just to send patches upstream for review normally (with me as a reviewer) until I stop getting to them or it's clear that we don't have similar viewpoints on what constitutes a desirable patch.

(That was really me.)

Thanks!

In a perfect world, I think the "most correct" approach here might be to allow an internal state of "April 31", and clamp it back to "April 30" when the display or storage layers read it. With this reproduction case:

  • Select Jan 31 2020 in a date picker, open the date picker again, press Next Month, press Previous Month. You end up on:
  • Old behavior: Feb 3
  • New behavior (with this patch): Jan 28
  • "Most correct" behavior: Jan 31

This patch is a big improvement and completely correcting this is likely a headache, though, so I think this is a reasonable step forward.

This revision is now accepted and ready to land.Jun 24 2021, 5:40 PM

I added you to Blessed Committers, so you should be able to land this yourself. See that project description for guidance, or let me know if you run into issues.

This revision was automatically updated to reflect the committed changes.

Thank you! Looks like it worked.