feat(SW-2863): Move contentstack router to trpc package * Add exports to packages and lint rule to prevent relative imports * Add env to trpc package * Add eslint to trpc package * Apply lint rules * Use direct imports from trpc package * Add lint-staged config to trpc * Move lang enum to common * Restructure trpc package folder structure * WIP first step * update internal imports in trpc * Fix most errors in scandic-web Just 100 left... * Move Props type out of trpc * Fix CategorizedFilters types * Move more schemas in hotel router * Fix deps * fix getNonContentstackUrls * Fix import error * Fix entry error handling * Fix generateMetadata metrics * Fix alertType enum * Fix duplicated types * lint:fix * Merge branch 'master' into feat/sw-2863-move-contentstack-router-to-trpc-package * Fix broken imports * Merge branch 'master' into feat/sw-2863-move-contentstack-router-to-trpc-package Approved-by: Linus Flood
42 lines
1.2 KiB
TypeScript
42 lines
1.2 KiB
TypeScript
import "dayjs/locale/da"
|
|
import "dayjs/locale/de"
|
|
import "dayjs/locale/fi"
|
|
import "dayjs/locale/sv"
|
|
|
|
import d from "dayjs"
|
|
import nb from "dayjs/locale/nb"
|
|
import advancedFormat from "dayjs/plugin/advancedFormat"
|
|
import customParseFormat from "dayjs/plugin/customParseFormat"
|
|
import duration from "dayjs/plugin/duration"
|
|
import isBetween from "dayjs/plugin/isBetween"
|
|
import isSameOrAfter from "dayjs/plugin/isSameOrAfter"
|
|
import isSameOrBefore from "dayjs/plugin/isSameOrBefore"
|
|
import isToday from "dayjs/plugin/isToday"
|
|
import relativeTime from "dayjs/plugin/relativeTime"
|
|
import timezone from "dayjs/plugin/timezone"
|
|
import utc from "dayjs/plugin/utc"
|
|
|
|
/**
|
|
* dayjs export Norwegian as nb [Norwegian Bokmål] so here we create the same
|
|
* setup as nb has.
|
|
* https://day.js.org/docs/en/customization/customization
|
|
* https://github.com/iamkun/dayjs/blob/dev/src/locale/nb.js
|
|
*/
|
|
d.locale("no", { ...nb, name: "no" }, true)
|
|
|
|
/**
|
|
* If more plugins are needed https://day.js.org/docs/en/plugin/plugin
|
|
*/
|
|
d.extend(advancedFormat)
|
|
d.extend(isToday)
|
|
d.extend(relativeTime)
|
|
d.extend(timezone)
|
|
d.extend(utc)
|
|
d.extend(isSameOrAfter)
|
|
d.extend(isSameOrBefore)
|
|
d.extend(duration)
|
|
d.extend(customParseFormat)
|
|
d.extend(isBetween)
|
|
|
|
export const dt = d
|