The CLDR-data have skeleton pattern entries which allow to generate patterns for date and time just based on locale, text width and a choice of "skeleton" identifiers (ruling which date-time-elements shall be used). Example from German data:
-<dateTimeFormats>
-<dateTimeFormatLength type="full">
-<dateTimeFormat>
<pattern>{1} 'um' {0}</pattern>
</dateTimeFormat>
</dateTimeFormatLength>
-<dateTimeFormatLength type="long">
-<dateTimeFormat>
<pattern>{1} 'um' {0}</pattern>
</dateTimeFormat>
</dateTimeFormatLength>
-<dateTimeFormatLength type="medium">
-<dateTimeFormat>
<pattern>{1}, {0}</pattern>
</dateTimeFormat>
</dateTimeFormatLength>
-<dateTimeFormatLength type="short">
-<dateTimeFormat>
<pattern>{1}, {0}</pattern>
</dateTimeFormat>
</dateTimeFormatLength>
-<availableFormats>
<dateFormatItem id="Bh">h B</dateFormatItem>
<dateFormatItem id="Bhm">h:mm B</dateFormatItem>
<dateFormatItem id="Bhms">h:mm:ss B</dateFormatItem>
<dateFormatItem id="d">d</dateFormatItem>
<dateFormatItem id="E">ccc</dateFormatItem>
<dateFormatItem id="EBhm">E h:mm B</dateFormatItem>
<dateFormatItem id="EBhms">E h:mm:ss B</dateFormatItem>
<dateFormatItem id="Ed">E, d.</dateFormatItem>
<dateFormatItem id="Ehm">E h:mm a</dateFormatItem>
<dateFormatItem id="EHm">E, HH:mm</dateFormatItem>
<dateFormatItem id="Ehms">E, h:mm:ss a</dateFormatItem>
<dateFormatItem id="EHms">E, HH:mm:ss</dateFormatItem>
<dateFormatItem id="Gy">y G</dateFormatItem>
<dateFormatItem id="GyMMM">MMM y G</dateFormatItem>
<dateFormatItem id="GyMMMd">d. MMM y G</dateFormatItem>
<dateFormatItem id="GyMMMEd">E, d. MMM y G</dateFormatItem>
<dateFormatItem id="h">h 'Uhr' a</dateFormatItem>
<dateFormatItem id="H">HH 'Uhr'</dateFormatItem>
<dateFormatItem id="hm">h:mm a</dateFormatItem>
<dateFormatItem id="Hm">HH:mm</dateFormatItem>
<dateFormatItem id="hms">h:mm:ss a</dateFormatItem>
<dateFormatItem id="Hms">HH:mm:ss</dateFormatItem>
The skeleton identifiers might be modelled as enums which look like DateSkeleton.YMD or TimeSkeleton.HMSA and can be used either just for date or time patterns or can be combined by and(...)-methods to form date-time-patterns using a generator-method like createPattern(Locale, TextWidth).
The CLDR-data have skeleton pattern entries which allow to generate patterns for date and time just based on locale, text width and a choice of "skeleton" identifiers (ruling which date-time-elements shall be used). Example from German data:
The skeleton identifiers might be modelled as enums which look like
DateSkeleton.YMDorTimeSkeleton.HMSAand can be used either just for date or time patterns or can be combined byand(...)-methods to form date-time-patterns using a generator-method likecreatePattern(Locale, TextWidth).