fix(webui): edit books dialog would not open on some browsers

Closes: #1139
This commit is contained in:
Gauthier Roebroeck 2023-06-29 10:03:32 +08:00
parent f07c37114c
commit 308a068f42
2 changed files with 18 additions and 2 deletions

View file

@ -177,7 +177,7 @@
:show-current="true"
:show-adjacent-months="true"
:locale="$i18n.locale"
:first-day-of-week="new Intl.Locale($i18n.locale).weekInfo.firstDay"
:first-day-of-week="$store.getters.getLocaleFirstDay()"
@input="menuDate = false"
@change="form.releaseDateLock = true"
/>

View file

@ -33,9 +33,25 @@ export const persistedModule: Module<any, any> = {
route: {},
},
importPath: '',
duplicatesNewPageSize: 10,
duplicatesNewPageSize: 10,
},
getters: {
getLocaleFirstDay: (state) => () => {
try {
// @ts-ignore
const loc = new Intl.Locale(state.locale)
try {
return loc.getWeekInfo().firstDay
} catch (e) {
}
try {
return loc.weekInfo.firstDay
} catch (e) {
}
} catch (e) {
}
return 1
},
getCollectionFilter: (state) => (id: string) => {
return state.collection.filter[id]
},