feat(WEB-128): desktop and mobile initial wireframe implemented
This commit is contained in:
60
lib/dt.ts
Normal file
60
lib/dt.ts
Normal file
@@ -0,0 +1,60 @@
|
||||
import d from "dayjs"
|
||||
import isToday from "dayjs/plugin/isToday"
|
||||
import relativeTime from "dayjs/plugin/relativeTime"
|
||||
|
||||
import "dayjs/locale/da"
|
||||
import "dayjs/locale/de"
|
||||
import "dayjs/locale/fi"
|
||||
import "dayjs/locale/sv"
|
||||
|
||||
/**
|
||||
* 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", {
|
||||
name: "no",
|
||||
weekdays: "søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),
|
||||
weekdaysShort: "sø._ma._ti._on._to._fr._lø.".split("_"),
|
||||
weekdaysMin: "sø_ma_ti_on_to_fr_lø".split("_"),
|
||||
months:
|
||||
"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split(
|
||||
"_"
|
||||
),
|
||||
monthsShort:
|
||||
"jan._feb._mars_april_mai_juni_juli_aug._sep._okt._nov._des.".split("_"),
|
||||
ordinal: (n: any) => `${n}.`,
|
||||
weekStart: 1,
|
||||
formats: {
|
||||
LT: "HH:mm",
|
||||
LTS: "HH:mm:ss",
|
||||
L: "DD.MM.YYYY",
|
||||
LL: "D. MMMM YYYY",
|
||||
LLL: "D. MMMM YYYY [kl.] HH:mm",
|
||||
LLLL: "dddd D. MMMM YYYY [kl.] HH:mm",
|
||||
},
|
||||
relativeTime: {
|
||||
future: "om %s",
|
||||
past: "%s siden",
|
||||
s: "noen sekunder",
|
||||
m: "ett minutt",
|
||||
mm: "%d minutter",
|
||||
h: "en time",
|
||||
hh: "%d timer",
|
||||
d: "en dag",
|
||||
dd: "%d dager",
|
||||
M: "en måned",
|
||||
MM: "%d måneder",
|
||||
y: "ett år",
|
||||
yy: "%d år",
|
||||
},
|
||||
})
|
||||
|
||||
/**
|
||||
* If more plugins are needed https://day.js.org/docs/en/plugin/plugin
|
||||
*/
|
||||
d.extend(isToday)
|
||||
d.extend(relativeTime)
|
||||
|
||||
export const dt = d
|
||||
Reference in New Issue
Block a user