diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-03-30 23:50:34 +0200 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-03-30 23:50:34 +0200 |
commit | e14c686ac0ad5e6cfdd933049c11b80a425283dc (patch) | |
tree | 2898de2582c3ea07ac781fafbf079fed790ef888 /toolkit/content/widgets/datepicker.js | |
parent | 77fbaff2faf6fc341e30a309f7e68458f2864ad9 (diff) | |
download | UXP-e14c686ac0ad5e6cfdd933049c11b80a425283dc.tar UXP-e14c686ac0ad5e6cfdd933049c11b80a425283dc.tar.gz UXP-e14c686ac0ad5e6cfdd933049c11b80a425283dc.tar.lz UXP-e14c686ac0ad5e6cfdd933049c11b80a425283dc.tar.xz UXP-e14c686ac0ad5e6cfdd933049c11b80a425283dc.zip |
Bug 1381421 - (Part 1) Handle dates earlier than 0001-01-01 and later than 275760-09-13 correctly
Diffstat (limited to 'toolkit/content/widgets/datepicker.js')
-rw-r--r-- | toolkit/content/widgets/datepicker.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/toolkit/content/widgets/datepicker.js b/toolkit/content/widgets/datepicker.js index 0c288d917..f5659b736 100644 --- a/toolkit/content/widgets/datepicker.js +++ b/toolkit/content/widgets/datepicker.js @@ -54,7 +54,7 @@ function DatePicker(context) { dateKeeper, locale, isMonthPickerVisible: false, - getDayString: new Intl.NumberFormat(locale).format, + getDayString: day => day ? new Intl.NumberFormat(locale).format(day) : "", getWeekHeaderString: weekday => weekdayStrings[weekday], getMonthString: month => monthStrings[month], setSelection: date => { @@ -101,7 +101,10 @@ function DatePicker(context) { this.components = { calendar: new Calendar({ calViewSize: CAL_VIEW_SIZE, - locale: this.state.locale + locale: this.state.locale, + setSelection: this.state.setSelection, + getDayString: this.state.getDayString, + getWeekHeaderString: this.state.getWeekHeaderString }, { weekHeader: this.context.weekHeader, daysView: this.context.daysView @@ -141,10 +144,7 @@ function DatePicker(context) { this.components.calendar.setProps({ isVisible: !isMonthPickerVisible, days: this.state.days, - weekHeaders: dateKeeper.state.weekHeaders, - setSelection: this.state.setSelection, - getDayString: this.state.getDayString, - getWeekHeaderString: this.state.getWeekHeaderString + weekHeaders: dateKeeper.state.weekHeaders }); isMonthPickerVisible ? @@ -254,8 +254,8 @@ function DatePicker(context) { set({ year, month, day }) { const { dateKeeper } = this.state; - dateKeeper.set({ - year, month, day + dateKeeper.setCalendarMonth({ + year, month }); dateKeeper.setSelection({ year, month, day |