UNPKG

@fifteen/design-system-vue

Version:

Vue 3 (Composition API + Typescript) implementation of the Fifteen Design System

2 lines (1 loc) 1.04 kB
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../../../isSameWeek.js"),o=require("../../../toDate.js"),r=["нядзелю","панядзелак","аўторак","сераду","чацвер","пятніцу","суботу"];function u(e){const t=r[e];switch(e){case 0:case 3:case 5:case 6:return"'у мінулую "+t+" а' p";case 1:case 2:case 4:return"'у мінулы "+t+" а' p"}}function i(e){return"'у "+r[e]+" а' p"}function k(e){const t=r[e];switch(e){case 0:case 3:case 5:case 6:return"'у наступную "+t+" а' p";case 1:case 2:case 4:return"'у наступны "+t+" а' p"}}const f=(e,t,c)=>{const s=o.toDate(e),a=s.getDay();return n.isSameWeek(s,t,c)?i(a):u(a)},y=(e,t,c)=>{const s=o.toDate(e),a=s.getDay();return n.isSameWeek(s,t,c)?i(a):k(a)},l={lastWeek:f,yesterday:"'учора а' p",today:"'сёння а' p",tomorrow:"'заўтра а' p",nextWeek:y,other:"P"},d=(e,t,c,s)=>{const a=l[e];return typeof a=="function"?a(t,c,s):a};exports.formatRelative=d;