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 605 forks source link

skeleton: "Bhm" is not supported #936

Open LilyLi2019 opened 1 year ago

LilyLi2019 commented 1 year ago

I used skeleton: "Bhm" to format a date. It throwed following exception: code: 'E_INVALID_OPTIONS', invalidField: 'B', type: 'skeleton', value: 'Bhm'

My code:

var format2 = Globalize("zh-Hans").dateFormatter({ skeleton: "Bhm"})(new Date());
console.log(format2);

Could you please support 'B' in skeleton?

rxaviers commented 1 year ago

Hi @LilyLi2019, that's correct, the B pattern needs to be implemente. PR is welcome. Thanks