Module 386221

2,266 characters · in 514.d733764d42c2ab66.js
Dependencies
Required by (1)
Lazily required by (0)none
Requires (0)none
Lazily requires (0)none
Source Raw
function(e,t){"use strict";t.createDateTimeFormat=u,t.createDateTimeFormats=function(e){var t,n,r,i,a,o=e.availableFormats,c=e.timeFormats,d=e.dateFormats,f=e.medium,p=[],h=[],m=[];function g(e,t){var n=Array((e.match(/M/g)||[]).length+1),r=Array((e.match(/E/g)||[]).length+1);return n.length>2&&(t=t.replace(/(M|L)+/,n.join("$1"))),r.length>2&&(t=t.replace(/([Eec])+/,r.join("$1"))),t}for(t in o)o.hasOwnProperty(t)&&(r=u(n=g(t,o[t])))&&(p.push(r),function(e){for(var t=0;t<l.length;t+=1)if(e.hasOwnProperty(l[t]))return!1;return!0}(r)?m.push(n):function(e){for(var t=0;t<s.length;t+=1)if(e.hasOwnProperty(s[t]))return!1;return!0}(r)&&h.push(n));for(i=0;i<h.length;i+=1)for(a=0;a<m.length;a+=1)(r=u(n=f.replace("{0}",h[i]).replace("{1}",m[a]).replace(/^[,\s]+|[,\s]+$/gi,"")))&&p.push(r);for(t in c)c.hasOwnProperty(t)&&(r=u(n=g(t,c[t])))&&p.push(r);for(t in d)d.hasOwnProperty(t)&&(r=u(n=g(t,d[t])))&&p.push(r);return p};var n=/(?:[Eec]{1,6}|G{1,5}|(?:[yYu]+|U{1,5})|[ML]{1,5}|d{1,2}|a|[hkHK]{1,2}|m{1,2}|s{1,2}|z{1,4})(?=([^']*'[^']*')*[^']*$)/g,r=/[QxXVOvZASjgFDwWIQqH]/,i=["numeric","2-digit","short","long","narrow"],a=["short","short","short","long","narrow"],o=["short","short","short","long","narrow"],s=["weekday","era","year","month","day"],l=["hour","minute","second","timeZoneName"];function u(e){if(!r.test(e)){var t={};return t.pattern=e.replace(n,function(e){switch(e.charAt(0)){case"E":case"e":case"c":return t.weekday=a[e.length-1],"{weekday}";case"G":return t.era=o[e.length-1],"{era}";case"y":case"Y":case"u":case"U":return t.year=2===e.length?"2-digit":"numeric","{year}";case"M":case"L":return t.month=i[e.length-1],"{month}";case"d":return t.day=2===e.length?"2-digit":"numeric","{day}";case"a":return"{ampm}";case"h":case"H":case"k":case"K":return t.hour=2===e.length?"2-digit":"numeric","{hour}";case"m":return t.minute=2===e.length?"2-digit":"numeric","{minute}";case"s":return t.second=2===e.length?"2-digit":"numeric","{second}";case"z":return t.timeZoneName=e.length<4?"short":"long","{timeZoneName}"}}),t.pattern=t.pattern.replace(/'([^']*)'/g,function(e,t){return t||"'"}),t.pattern.indexOf("{ampm}")>-1&&(t.hour12=!0,t.pattern12=t.pattern,t.pattern=t.pattern.replace("{ampm}","").replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")),t}}}