MCPcopy
hub / github.com/iamkun/dayjs / getShort

Function getShort

src/plugin/localeData/index.js:6–14  ·  view source on GitHub ↗
(ins, target, full, num, localeOrder)

Source from the content-addressed store, hash-verified

4 const proto = c.prototype
5 const getLocalePart = part => (part && (part.indexOf ? part : part.s))
6 const getShort = (ins, target, full, num, localeOrder) => {
7 const locale = ins.name ? ins : ins.$locale()
8 const targetLocale = getLocalePart(locale[target])
9 const fullLocale = getLocalePart(locale[full])
10 const result = targetLocale || fullLocale.map(f => f.slice(0, num))
11 if (!localeOrder) return result
12 const { weekStart } = locale
13 return result.map((_, index) => (result[(index + (weekStart || 0)) % 7]))
14 }
15 const getDayjsLocaleObject = () => dayjs.Ls[dayjs.locale()]
16 const getLongDateFormat = (l, format) =>
17 l.formats[format] || t(l.formats[format.toUpperCase()])

Callers 3

matchesMethod · 0.85
localeDataFunction · 0.85
index.jsFile · 0.85

Calls 2

$localeMethod · 0.80
getLocalePartFunction · 0.70

Tested by

no test coverage detected