import type { Quarter } from '../../../../types' ; import type { Localize , LocalizeFn } from '../../../types' ; import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index' ; const eraValues = { narrow : [ 'fvt' , 'vt' ] as const , abbreviated : [ 'f.v.t.' , 'v.t.' ] as const , wide : [ 'før vesterlandsk tidsregning' , 'vesterlandsk tidsregning' ] as const , } ; const quarterValues = { narrow : [ '1' , '2' , '3' , '4' ] as const , abbreviated : [ '1. kvt.' , '2. kvt.' , '3. kvt.' , '4. kvt.' ] as const , wide : [ '1. kvartal' , '2. kvartal' , '3. kvartal' , '4. kvartal' ] as const , } ; const monthValues = { narrow : [ 'J' , 'F' , 'M' , 'A' , 'M' , 'J' , 'J' , 'A' , 'S' , 'O' , 'N' , 'D' ] as const , abbreviated : [ 'jan.' , 'feb.' , 'mar.' , 'apr.' , 'maj' , 'jun.' , 'jul.' , 'aug.' , 'sep.' , 'okt.' , 'nov.' , 'dec.' , ] as const , wide : [ 'januar' , 'februar' , 'marts' , 'april' , 'maj' , 'juni' , 'juli' , 'august' , 'september' , 'oktober' , 'november' , 'december' , ] as const , } ; const dayValues = { narrow : [ 'S' , 'M' , 'T' , 'O' , 'T' , 'F' , 'L' ] as const , short : [ 'sø' , 'ma' , 'ti' , 'on' , 'to' , 'fr' , 'lø' ] as const , abbreviated : [ 'søn.' , 'man.' , 'tir.' , 'ons.' , 'tor.' , 'fre.' , 'lør.' , ] as const , wide : [ 'søndag' , 'mandag' , 'tirsdag' , 'onsdag' , 'torsdag' , 'fredag' , 'lørdag' , ] as const , } ; const dayPeriodValues = { narrow : { am : 'a' , pm : 'p' , midnight : 'midnat' , noon : 'middag' , morning : 'morgen' , afternoon : 'eftermiddag' , evening : 'aften' , night : 'nat' , } , abbreviated : { am : 'AM' , pm : 'PM' , midnight : 'midnat' , noon : 'middag' , morning : 'morgen' , afternoon : 'eftermiddag' , evening : 'aften' , night : 'nat' , } , wide : { am : 'a.m.' , pm : 'p.m.' , midnight : 'midnat' , noon : 'middag' , morning : 'morgen' , afternoon : 'eftermiddag' , evening : 'aften' , night : 'nat' , } , } ; const formattingDayPeriodValues = { narrow : { am : 'a' , pm : 'p' , midnight : 'midnat' , noon : 'middag' , morning : 'om morgenen' , afternoon : 'om eftermiddagen' , evening : 'om aftenen' , night : 'om natten' , } , abbreviated : { am : 'AM' , pm : 'PM' , midnight : 'midnat' , noon : 'middag' , morning : 'om morgenen' , afternoon : 'om eftermiddagen' , evening : 'om aftenen' , night : 'om natten' , } , wide : { am : 'a.m.' , pm : 'p.m.' , midnight : 'midnat' , noon : 'middag' , morning : 'om morgenen' , afternoon : 'om eftermiddagen' , evening : 'om aftenen' , night : 'om natten' , } , } ; const ordinalNumber = ( dirtyNumber , _options ) => { const number = Number ( dirtyNumber ) ; return number + '.' ; } ; const localize = { ordinalNumber , era : buildLocalizeFn ( { values : eraValues , defaultWidth : 'wide' , } ) , quarter : buildLocalizeFn ( { values : quarterValues , defaultWidth : 'wide' , argumentCallback : ( quarter ) => ( quarter - 1 ) as Quarter , } ) , month : buildLocalizeFn ( { values : monthValues , defaultWidth : 'wide' , } ) , day : buildLocalizeFn ( { values : dayValues , defaultWidth : 'wide' , } ) , dayPeriod : buildLocalizeFn ( { values : dayPeriodValues , defaultWidth : 'wide' , formattingValues : formattingDayPeriodValues , defaultFormattingWidth : 'wide' , } ) , } ; export default localize ;