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() {
|
||||
const appSettings = useStore($settings);
|
||||
|
||||
return createMemo(() => {
|
||||
const settings = appSettings();
|
||||
if (typeof settings.region !== "undefined") {
|
||||
return settings.region;
|
||||
} else {
|
||||
return autoMatchRegion();
|
||||
}
|
||||
});
|
||||
return createMemo(
|
||||
() => {
|
||||
const settings = appSettings();
|
||||
if (typeof settings.region !== "undefined") {
|
||||
return settings.region;
|
||||
} else {
|
||||
return autoMatchRegion();
|
||||
}
|
||||
},
|
||||
"en_GB",
|
||||
{ name: "region" },
|
||||
);
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
export const DateFnScope: ParentComponent = (props) => {
|
||||
const [dateFnLocale, setDateFnLocale] = createSignal(enGB);
|
||||
const [dateFnLocale, setDateFnLocale] = createSignal(enGB, {
|
||||
name: "dateFnLocale",
|
||||
});
|
||||
const region = useRegion();
|
||||
|
||||
createEffect(() => {
|
||||
|
|
Loading…
Reference in a new issue