summaryrefslogtreecommitdiffstats
path: root/toolkit
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-03-31 11:33:23 +0200
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-03-31 11:33:23 +0200
commitf4d1b4804a0dad0a616b01edc31187dace152165 (patch)
treead524f20c62cfdb49a453c734801b8f55e046b6d /toolkit
parent78074eb34ffd54e9af8ed7458e0a9af0b13ee2b1 (diff)
downloadUXP-f4d1b4804a0dad0a616b01edc31187dace152165.tar
UXP-f4d1b4804a0dad0a616b01edc31187dace152165.tar.gz
UXP-f4d1b4804a0dad0a616b01edc31187dace152165.tar.lz
UXP-f4d1b4804a0dad0a616b01edc31187dace152165.tar.xz
UXP-f4d1b4804a0dad0a616b01edc31187dace152165.zip
moebius#110: HTML - input - datetime - Datepicker shows incorrect month for the first day of the month
Diffstat (limited to 'toolkit')
-rw-r--r--toolkit/content/widgets/datepicker.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/toolkit/content/widgets/datepicker.js b/toolkit/content/widgets/datepicker.js
index 4387ae632..0e9c9a6e6 100644
--- a/toolkit/content/widgets/datepicker.js
+++ b/toolkit/content/widgets/datepicker.js
@@ -279,9 +279,11 @@ function DatePicker(context) {
*/
function MonthYear(options, context) {
const spinnerSize = 5;
- const yearFormat = new Intl.DateTimeFormat(options.locale, { year: "numeric" }).format;
- const dateFormat = new Intl.DateTimeFormat(options.locale, { year: "numeric", month: "long" }).format;
-
+ const yearFormat = new Intl.DateTimeFormat(options.locale, { year: "numeric",
+ timeZone: "UTC" }).format;
+ const dateFormat = new Intl.DateTimeFormat(options.locale, { year: "numeric",
+ month: "long",
+ timeZone: "UTC" }).format;
this.context = context;
this.state = { dateFormat };
this.props = {};
@@ -299,7 +301,7 @@ function DatePicker(context) {
this.state.isYearSet = true;
options.setYear(year);
},
- getDisplayString: year => yearFormat(new Date(new Date(0).setFullYear(year))),
+ getDisplayString: year => yearFormat(new Date(new Date(0).setUTCFullYear(year))),
viewportSize: spinnerSize
}, context.monthYearView)
};