mirror of
https://github.com/lukevella/rallly.git
synced 2025-06-17 01:51:48 +02:00
✨ Update admin layout and pages (#976)
This commit is contained in:
parent
0ba7e9ce91
commit
a1bac0c986
81 changed files with 2053 additions and 1260 deletions
|
@ -205,6 +205,15 @@ export const DayjsProvider: React.FunctionComponent<{
|
|||
return await dayjsLocales[l].import();
|
||||
}, [l]);
|
||||
|
||||
const preferredTimeZone = config?.timeZone ?? getBrowserTimeZone();
|
||||
|
||||
const adjustTimeZone = React.useCallback(
|
||||
(date: dayjs.ConfigType, keepLocalTime = false) => {
|
||||
return dayjs(date).tz(preferredTimeZone, keepLocalTime);
|
||||
},
|
||||
[preferredTimeZone],
|
||||
);
|
||||
|
||||
if (!state.value) {
|
||||
// wait for locale to load before rendering
|
||||
return null;
|
||||
|
@ -234,16 +243,10 @@ export const DayjsProvider: React.FunctionComponent<{
|
|||
dayjs.locale(dayjsLocale);
|
||||
}
|
||||
|
||||
const preferredTimeZone = config?.timeZone ?? getBrowserTimeZone();
|
||||
|
||||
return (
|
||||
<DayjsContext.Provider
|
||||
value={{
|
||||
adjustTimeZone: (date, keepLocalTime) => {
|
||||
return keepLocalTime
|
||||
? dayjs(date).utc()
|
||||
: dayjs(date).tz(preferredTimeZone);
|
||||
},
|
||||
adjustTimeZone,
|
||||
dayjs,
|
||||
locale: localeConfig, // locale defaults
|
||||
timeZone: preferredTimeZone,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue