All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.bower_components.globalize.src.date.expand-pattern.min.js Maven / Gradle / Ivy

There is a newer version: 1.2.2.1-jre17
Show newest version
define(["../common/format-message","../common/create-error/invalid-parameter-value"],function(formatMessage,createErrorInvalidParameterValue){return function(options,cldr){var dateSkeleton,result,skeleton,timeSkeleton,type;function combineDateTime(type,datePattern,timePattern){return formatMessage(cldr.main(["dates/calendars/gregorian/dateTimeFormats",type]),[timePattern,datePattern])}switch(true){case"skeleton"in options:skeleton=options.skeleton;result=cldr.main(["dates/calendars/gregorian/dateTimeFormats/availableFormats",skeleton]);if(!result){timeSkeleton=skeleton.split(/[^hHKkmsSAzZOvVXx]/).slice(-1)[0];dateSkeleton=skeleton.split(/[^GyYuUrQqMLlwWdDFgEec]/)[0];if(/(MMMM|LLLL).*[Ec]/.test(dateSkeleton)){type="full"}else if(/MMMM/g.test(dateSkeleton)){type="long"}else if(/MMM/g.test(dateSkeleton)||/LLL/g.test(dateSkeleton)){type="medium"}else{type="short"}result=combineDateTime(type,cldr.main(["dates/calendars/gregorian/dateTimeFormats/availableFormats",dateSkeleton]),cldr.main(["dates/calendars/gregorian/dateTimeFormats/availableFormats",timeSkeleton]))}break;case"date"in options:case"time"in options:result=cldr.main(["dates/calendars/gregorian","date"in options?"dateFormats":"timeFormats",options.date||options.time]);break;case"datetime"in options:result=combineDateTime(options.datetime,cldr.main(["dates/calendars/gregorian/dateFormats",options.datetime]),cldr.main(["dates/calendars/gregorian/timeFormats",options.datetime]));break;case"raw"in options:result=options.raw;break;default:throw createErrorInvalidParameterValue({name:"options",value:options})}return result}});




© 2015 - 2025 Weber Informatics LLC | Privacy Policy