UNPKG

@gsretail.com/gui-core

Version:

A skeleton to create your own React component library using Rollup, TypeScript, Sass and Storybook

2 lines (1 loc) 726 B
import a from"../../../@date-io/date-fns/build/index.esm.js";import o from"date-fns/locale/en-US";import t from"date-fns/_lib/format/longFormatters";const e={y:"year",yy:"year",yyy:"year",yyyy:"year",MMMM:"month",MM:"month",DD:"day",d:"day",dd:"day",H:"hour",HH:"hour",h:"hour",hh:"hour",mm:"minute",ss:"second",a:"am-pm",aa:"am-pm",aaa:"am-pm"};class r extends a{constructor(...a){super(...a),this.formatTokenMap=e,this.expandFormat=a=>a.match(/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g).map((a=>{const e=a[0];if("p"===e||"P"===e){return(0,t[e])(a,(this.locale||o).formatLong,{})}return a})).join(""),this.getFormatHelperText=a=>this.expandFormat(a).replace(/(aaa|aa|a)/g,"(a|p)m").toLocaleLowerCase()}}export{r as AdapterDateFns};