mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-30 11:07:29 +09:00
moebius#110: HTML - input - datetime - Datepicker shows incorrect month for the first day of the month
This commit is contained in:
parent
1a36c4a8ac
commit
7a160547e5
1 changed files with 6 additions and 4 deletions
|
|
@ -279,9 +279,11 @@ function DatePicker(context) {
|
||||||
*/
|
*/
|
||||||
function MonthYear(options, context) {
|
function MonthYear(options, context) {
|
||||||
const spinnerSize = 5;
|
const spinnerSize = 5;
|
||||||
const yearFormat = new Intl.DateTimeFormat(options.locale, { year: "numeric" }).format;
|
const yearFormat = new Intl.DateTimeFormat(options.locale, { year: "numeric",
|
||||||
const dateFormat = new Intl.DateTimeFormat(options.locale, { year: "numeric", month: "long" }).format;
|
timeZone: "UTC" }).format;
|
||||||
|
const dateFormat = new Intl.DateTimeFormat(options.locale, { year: "numeric",
|
||||||
|
month: "long",
|
||||||
|
timeZone: "UTC" }).format;
|
||||||
this.context = context;
|
this.context = context;
|
||||||
this.state = { dateFormat };
|
this.state = { dateFormat };
|
||||||
this.props = {};
|
this.props = {};
|
||||||
|
|
@ -299,7 +301,7 @@ function DatePicker(context) {
|
||||||
this.state.isYearSet = true;
|
this.state.isYearSet = true;
|
||||||
options.setYear(year);
|
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
|
viewportSize: spinnerSize
|
||||||
}, context.monthYearView)
|
}, context.monthYearView)
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue