date-and-time
Version:
The simplest, most intuitive date and time library
2 lines (1 loc) • 758 B
JavaScript
class e{}const o=(e,o,t)=>e.reduce((e,l,a)=>l.length>e.length&&!o.indexOf(l)?{value:a,length:l.length,token:t}:e,{value:-1,length:0,token:t});const t=new class extends e{dddd(e,t,l){const a=t.locale.getDayOfWeekList({style:"long",compiledObj:l}),s=t.locale.getLocale();return t.ignoreCase?o(a.map(e=>e.toLocaleLowerCase(s)),e.toLocaleLowerCase(s)):o(a,e)}ddd(e,t,l){const a=t.locale.getDayOfWeekList({style:"short",compiledObj:l}),s=t.locale.getLocale();return t.ignoreCase?o(a.map(e=>e.toLocaleLowerCase(s)),e.toLocaleLowerCase(s)):o(a,e)}dd(e,t,l){const a=t.locale.getDayOfWeekList({style:"narrow",compiledObj:l}),s=t.locale.getLocale();return t.ignoreCase?o(a.map(e=>e.toLocaleLowerCase(s)),e.toLocaleLowerCase(s)):o(a,e)}};exports.parser=t;
;