1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-21 10:21:16 -04:00

refactor .js files to ES modules where possible

This commit is contained in:
2024-03-12 14:58:00 -04:00
parent e66dc37c41
commit e1a26d5257
28 changed files with 460 additions and 414 deletions

View File

@@ -5,7 +5,7 @@ import dayjsRelativeTime from "dayjs/plugin/relativeTime";
import dayjsLocalizedFormat from "dayjs/plugin/localizedFormat";
import dayjsAdvancedFormat from "dayjs/plugin/advancedFormat";
import "dayjs/locale/en";
import { timeZone } from "../config";
import config from "../config";
const IsomorphicDayJs = (date?: dayjs.ConfigType): dayjs.Dayjs => {
// plugins
@@ -15,7 +15,7 @@ const IsomorphicDayJs = (date?: dayjs.ConfigType): dayjs.Dayjs => {
dayjs.extend(dayjsLocalizedFormat);
dayjs.extend(dayjsAdvancedFormat);
return dayjs(date).locale("en").tz(timeZone).clone();
return dayjs(date).locale("en").tz(config.timeZone).clone();
};
// simple wrapper around dayjs.format() to normalize timezone across the site, both server and client side, to prevent