META-INF.resources.bower_components.globalize.src.date.tokenizer-properties.min.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jwebmp-globalize Show documentation
Show all versions of jwebmp-globalize Show documentation
The JWebSwing implementation for a full Globalization
The newest version!
define(["./pattern-re","../common/create-error/unsupported-feature","../number/symbol","../util/object/filter"],function(datePatternRe,createErrorUnsupportedFeature,numberSymbol,objectFilter){return function(pattern,cldr){var properties={pattern:pattern,timeSeparator:numberSymbol("timeSeparator",cldr)},widths=["abbreviated","wide","narrow"];function populateProperties(path,value){properties[path.replace(/^.*\/dates\//,"").replace(/calendars\//,"")]=value}cldr.on("get",populateProperties);pattern.match(datePatternRe).forEach(function(current){var chr,length;chr=current.charAt(0),length=current.length;if(chr==="Z"&&length<5){chr="O";length=4}switch(chr){case"G":cldr.main(["dates/calendars/gregorian/eras",length<=3?"eraAbbr":length===4?"eraNames":"eraNarrow"]);break;case"u":case"U":throw createErrorUnsupportedFeature({feature:"year pattern `"+chr+"`"});case"Q":case"q":if(length>2){cldr.main(["dates/calendars/gregorian/quarters",chr==="Q"?"format":"stand-alone",widths[length-3]])}break;case"M":case"L":if(length>2){cldr.main(["dates/calendars/gregorian/months",chr==="M"?"format":"stand-alone",widths[length-3]])}break;case"g":throw createErrorUnsupportedFeature({feature:"Julian day pattern `g`"});case"e":case"c":if(length<=2){break}case"E":if(length===6){cldr.main(["dates/calendars/gregorian/days",[chr==="c"?"stand-alone":"format"],"short"])||cldr.main(["dates/calendars/gregorian/days",[chr==="c"?"stand-alone":"format"],"abbreviated"])}else{cldr.main(["dates/calendars/gregorian/days",[chr==="c"?"stand-alone":"format"],widths[length<3?0:length-3]])}break;case"a":cldr.main("dates/calendars/gregorian/dayPeriods/format/wide");properties["gregorian/dayPeriods/format/wide"]=objectFilter(properties["gregorian/dayPeriods/format/wide"],/^am|^pm/);break;case"z":case"O":cldr.main("dates/timeZoneNames/gmtFormat");cldr.main("dates/timeZoneNames/gmtZeroFormat");cldr.main("dates/timeZoneNames/hourFormat");break;case"v":case"V":throw createErrorUnsupportedFeature({feature:"timezone pattern `"+chr+"`"})}});cldr.off("get",populateProperties);return properties}});