globalizejs / globalize

A JavaScript library for internationalization and localization that leverages the official Unicode CLDR JSON data
https://globalizejs.com
MIT License
4.8k stars 603 forks source link

Date: Add formatDateToParts #700

Closed rxaviers closed 7 years ago

rxaviers commented 7 years ago

Supersedes #697, Fixes #678

List of part types, its respective CLDR date fields, and comparison with Intl DateTimeFormat formatToParts.

Globalize CLDR date fields Intl formatToParts
era era era
year year year
quarter quarter -
month month month
week week -
day day day
weekday weekday weekday
dayperiod dayperiod dayPeriod
hour hour hour
minute minute minute
second second second
zone zone timeZoneName
literal literal literal

List of part types and the corresponding CLDR date field patterns.

part type CLDR date field CLDR date field patterns
era era G
year year yY
quarter quarter qQ
month month ML
week week wW
day day dDF
weekday weekday ecE
dayperiod dayperiod a
hour hour hHkK
minute minute m
second second sSA
zone zone zOxX
literal literal

Checklist: Checklist

jsf-clabot commented 7 years ago

CLA assistant check
All committers have signed the CLA.

rxaviers commented 7 years ago

@jzaefferer thanks for your review