This commit is contained in:
parent
637eda5ac1
commit
607fa64c05
1 changed files with 15 additions and 9 deletions
|
@ -73,14 +73,18 @@ export function autoMatchRegion() {
|
||||||
export function useRegion() {
|
export function useRegion() {
|
||||||
const appSettings = useStore($settings);
|
const appSettings = useStore($settings);
|
||||||
|
|
||||||
return createMemo(() => {
|
return createMemo(
|
||||||
|
() => {
|
||||||
const settings = appSettings();
|
const settings = appSettings();
|
||||||
if (typeof settings.region !== "undefined") {
|
if (typeof settings.region !== "undefined") {
|
||||||
return settings.region;
|
return settings.region;
|
||||||
} else {
|
} else {
|
||||||
return autoMatchRegion();
|
return autoMatchRegion();
|
||||||
}
|
}
|
||||||
});
|
},
|
||||||
|
"en_GB",
|
||||||
|
{ name: "region" },
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function importDateFnLocale(tag: string): Promise<Locale> {
|
async function importDateFnLocale(tag: string): Promise<Locale> {
|
||||||
|
@ -100,7 +104,9 @@ async function importDateFnLocale(tag: string): Promise<Locale> {
|
||||||
* Provides runtime values and fetch dependencies for date-fns locale
|
* Provides runtime values and fetch dependencies for date-fns locale
|
||||||
*/
|
*/
|
||||||
export const DateFnScope: ParentComponent = (props) => {
|
export const DateFnScope: ParentComponent = (props) => {
|
||||||
const [dateFnLocale, setDateFnLocale] = createSignal(enGB);
|
const [dateFnLocale, setDateFnLocale] = createSignal(enGB, {
|
||||||
|
name: "dateFnLocale",
|
||||||
|
});
|
||||||
const region = useRegion();
|
const region = useRegion();
|
||||||
|
|
||||||
createEffect(() => {
|
createEffect(() => {
|
||||||
|
|
Loading…
Reference in a new issue