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();
|
() => {
|
||||||
if (typeof settings.region !== "undefined") {
|
const settings = appSettings();
|
||||||
return settings.region;
|
if (typeof settings.region !== "undefined") {
|
||||||
} else {
|
return settings.region;
|
||||||
return autoMatchRegion();
|
} else {
|
||||||
}
|
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