summaryrefslogtreecommitdiffstats
path: root/toolkit/content/widgets/datepicker.js
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/content/widgets/datepicker.js')
-rw-r--r--toolkit/content/widgets/datepicker.js16
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