[Datepicker] Can't set the max day on mobile.
Categories
(Firefox for Android :: General, defect)
Tracking
()
People
(Reporter: gueux+mozilla, Assigned: corentin)
References
Details
(Whiteboard: [fxdroid] [android-activation-trust] )
Attachments
(3 files)
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:149.0) Gecko/20100101 Firefox/149.0
Firefox for Android
Steps to reproduce:
Using input of type="date" with a max field, I try to set the date to the max with the datepicker on mobile (note that there is no problem on desktop). For example on
https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input/date#try_it I'd like to set the date to 2018-12-31.
Actual results:
2018-12-31 is not selectable, only 2018-12-30 and before. I also tried to set it manually with the pencil, but 31/12/2018 is "outside of limits" ("Hors limite: 31 déc. 2018" in my French locale).
Expected results:
I should be able to set the date to the max.
| Reporter | ||
Comment 1•3 months ago
|
||
| Reporter | ||
Comment 2•3 months ago
|
||
The problem appears (at least) on 149 and 150, and only on mobile.
Comment 3•3 months ago
|
||
The Bugbug bot thinks this bug should belong to the 'Firefox for Android::General' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Updated•3 months ago
|
| Assignee | ||
Updated•11 days ago
|
| Assignee | ||
Comment 4•10 days ago
|
||
MaterialDatePicker represents its dates in UTC milliseconds and asks its validator about each day as midnight UTC. DateValidatorPointForward.from() and DateValidatorPointBackward.before() need to use the same UTC representation. The min and max dates were passed in the device timezone instead, so each bound was a moment in time rather than a day.
As a consequence:
- The max day was greyed out in timezones ahead of UTC
- The min day was greyed out in timezones behind UTC
- The min day was greyed out in every timezone when the min date had a time of day
toLocalDayStartAsUtcMillis() drops the time of day rather than shifting it by the offset and returns midnight UTC on that day. For max="2018-12-31" in Paris, the Date is 2018-12-30T23:00Z. toLocalDayStartAsUtcMillis() reads this date as 2018-12-31 in Parisand returns 2018-12-31T00:00Z. Before this change, this max date would remain 2018-12-30T23:00Z, making 2018-12-31 an invalid date on the calendar.
Updated•9 days ago
|
Comment 6•4 days ago
|
||
| bugherder | ||
Comment 7•4 days ago
|
||
Did you want to nominate this for the Fx156 relnotes? If so, set the relnote-firefox flag to "?"
https://wiki.mozilla.org/Release_Management/Release_Notes_Nomination
Possible wording:
Fixed the date picker ignoring the last selectable day when a page set a maximum date.
Updated•4 days ago
|
Updated•4 days ago
|
| Assignee | ||
Comment 8•3 days ago
|
||
[Tracking Requested - why for this release]: Fixed an issue where the date picker could prevent selecting the minimum or maximum allowed date.
| Assignee | ||
Comment 9•3 days ago
|
||
Thanks Donal!
Comment 10•3 days ago
|
||
Thanks, moved the tracking to a release note request
Comment 11•3 days ago
|
||
Added to the Fx156 nightly release notes, please allow 30 minutes for the site to update.
Description
•