Closed Bug 1320647 Opened 9 years ago Closed 8 years ago

[DateTimePicker] Add min/max support to date picker

Categories

(Core :: Layout: Form Controls, defect, P3)

53 Branch
defect

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: scottwu, Assigned: scottwu)

References

(Blocks 1 open bug)

Details

(Whiteboard: [milestone6])

Attachments

(1 file, 3 obsolete files)

No description provided.
Whiteboard: [milestone6]
WIP update - Improved styling for month-year button - Added new svg for arrows - Added min/max support - Working on step support
Priority: -- → P3
WIP update - Rebased to central - Implemented step for days on calendar - Will work on step support for months and years
Attachment #8815153 - Attachment is obsolete: true
Component: XUL Widgets → Layout: Form Controls
Product: Toolkit → Core
Version: unspecified → 53 Branch
Due to changes in spec, I'm breaking this bug up to smaller ones. This one will be for min/max specifically.
Summary: [DateTimePicker] Add min/max and step support to date picker → [DateTimePicker] Add min/max support to date picker
Attachment #8815153 - Attachment is obsolete: true
Attachment #8822009 - Attachment is obsolete: true
Attachment #8822010 - Attachment is obsolete: true
Attachment #8822011 - Attachment is obsolete: true
Attachment #8815153 - Flags: review?(mconley)
This patch implements support for the min and max attributes on <input type="date"/>. Dates outside of the min and max range are greyed-out and do not respond to clicks or hover. Also, the DateKeeper now uses a date object (instead of 3 separate attributes: year, month, day) to track of the date it is displaying. Mike, I wonder if you have time to review this bug? (and a few more to come) Thanks in advance!
Flags: needinfo?(mconley)
(In reply to Scott Wu [:scottwu] from comment #11) > Mike, I wonder if you have time to review this bug? (and a few more to come) > Thanks in advance! I think I'll be able to review this in the short term, yes. In future, btw, no need to needinfo? as well as r? me - the r? is sufficient on its own. :)
Flags: needinfo?(mconley)
Blocks: 1361676
Comment on attachment 8815153 [details] Bug 1320647 - Implement min and max for date picker. https://reviewboard.mozilla.org/r/96180/#review140254 Sorry for the delay - this looks good to me. Thanks! ::: toolkit/content/widgets/datekeeper.js:19 (Diff revision 4) > + MIN_DATE = -8640000000000000, > + MAX_DATE = 8640000000000000; I suspect you're deriving this from http://ecma-international.org/ecma-262/5.1/#sec-15.9.1.1, right? If so, can you please mention that? ::: toolkit/content/widgets/datekeeper.js:75 (Diff revision 4) > * {Number} month [optional] > * {Number} date [optional] > * } > */ > - set({ year = this.state.year, month = this.state.month, day = this.state.day }) { > - this._update(year, month, day); > + set({ year = this.year, month = this.month, day = this.day }) { > + // Use setUTCFullYear so that year 99 doesn't get parsed as 1999 Maybe we should mention this in the function header, that we're not taking the short-form for years?
Attachment #8815153 - Flags: review?(mconley) → review+
Comment on attachment 8815153 [details] Bug 1320647 - Implement min and max for date picker. https://reviewboard.mozilla.org/r/96180/#review140254 No worries. Thanks a lot Mike! > I suspect you're deriving this from http://ecma-international.org/ecma-262/5.1/#sec-15.9.1.1, right? If so, can you please mention that? Yeah I'll add a comment for that. > Maybe we should mention this in the function header, that we're not taking the short-form for years? Ok!
Keywords: checkin-needed
Pushed by ryanvm@gmail.com: https://hg.mozilla.org/integration/autoland/rev/ece97e873769 Implement min and max for date picker. r=mconley
Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: