Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add en-in and en-tt locales #855

Merged
merged 6 commits into from
Apr 3, 2020
Merged

Add en-in and en-tt locales #855

merged 6 commits into from
Apr 3, 2020

Conversation

ElliotAshby
Copy link
Contributor

Addition of en-in and en-tt locales as extensions of the en-gb locale so that the correct date formats are used for these locales rather than using the default en formatting.

@codecov
Copy link

codecov bot commented Apr 2, 2020

Codecov Report

Merging #855 into dev will not change coverage by %.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##               dev      #855   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          158       160    +2     
  Lines         1195      1205   +10     
  Branches       246       248    +2     
=========================================
+ Hits          1195      1205   +10     
Impacted Files Coverage Δ
src/locale/en-in.js 100.00% <100.00%> (ø)
src/locale/en-tt.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bd24034...5b98c98. Read the comment docs.

@iamkun
Copy link
Owner

iamkun commented Apr 3, 2020

Seems not quite necessary?

Why not just parse the locale string before passing into dayjs.locale?

@ElliotAshby
Copy link
Contributor Author

Well, we support A LOT of locales (or at least try to), so it wouldn't really be reasonable to have to check each and every locale for what should be used in it's stead. We currently default to the base language's locale if the specific country's locale is not supported but I imagine for a lot of locales this is not correct. I figured it'd be a good thing for dayjs to support as many locales as possible out of the box, especially this way, as it is rather lightweight.
A lot of the currently supported english locales I noticed are almost exactly the same, perhaps a similar approach could be adopted with those to make them more lightweight?

@iamkun
Copy link
Owner

iamkun commented Apr 3, 2020

Can you provide a list on Wikipedia or some alike that has these two locale strings, please?

Besides, please avoided using es6 syntax. Cause it will enlarge the final bundle size.

@ElliotAshby
Copy link
Contributor Author

Not entirely sure what you mean but I looked here at these links when confirming what was required.
http://www.localeplanet.com/icu/en-IN/index.html & http://www.localeplanet.com/icu/en-TT/index.html
So you'd rather have the locales defined in full to reduce bundle size?

@iamkun
Copy link
Owner

iamkun commented Apr 3, 2020

So you'd rather have the locales defined in full to reduce bundle size?

Yes, please.

And any difference between en-IN and en-in, or which one we should choose?

@ElliotAshby
Copy link
Contributor Author

I've dropped the ES6 syntax, although I saw no difference in build size locally.

As for en-IN vs. en-in, the capitalised country code is the standard as far as I'm aware. But the locales in dayjs use lowercase country codes (except en-SG, not sure why). Perhaps it would be good to make things consistent?

@iamkun
Copy link
Owner

iamkun commented Apr 3, 2020

Thanks, let's get this merged first. 😬

@iamkun iamkun merged commit c39fb96 into iamkun:dev Apr 3, 2020
@ElliotAshby
Copy link
Contributor Author

thanks

iamkun pushed a commit that referenced this pull request Apr 10, 2020
## [1.8.24](v1.8.23...v1.8.24) (2020-04-10)

### Bug Fixes

* Add config option to RelativeTime plugin ([#851](#851)) ([bd24034](bd24034))
* add Duration plugin ([#858](#858)) ([d568273](d568273))
* Add en-in, en-tt locales ([#855](#855)) ([c39fb96](c39fb96))
* add isToday, isTomorrow, isYesterday plugins ([#857](#857)) ([fc08ab6](fc08ab6))
* Add option callback to Calendar plugin ([#839](#839)) ([b25be90](b25be90))
* Fix monthsShort for locale fr ([#862](#862)) ([d2de9a0](d2de9a0))
* Update Breton locale (br) meridiem config ([#856](#856)) ([a2a6672](a2a6672))
* Update Ukrainian (uk) locale relative time ([#842](#842)) ([578bc1a](578bc1a))
@iamkun
Copy link
Owner

iamkun commented Apr 10, 2020

🎉 This PR is included in version 1.8.24 🎉

The release is available on:

Your semantic-release bot 📦🚀

andrewhood125ruhuc added a commit to andrewhood125ruhuc/SidRH2 that referenced this pull request May 10, 2022
## [1.8.24](iamkun/dayjs@v1.8.23...v1.8.24) (2020-04-10)

### Bug Fixes

* Add config option to RelativeTime plugin ([#851](iamkun/dayjs#851)) ([bd24034](iamkun/dayjs@bd24034))
* add Duration plugin ([#858](iamkun/dayjs#858)) ([d568273](iamkun/dayjs@d568273))
* Add en-in, en-tt locales ([#855](iamkun/dayjs#855)) ([c39fb96](iamkun/dayjs@c39fb96))
* add isToday, isTomorrow, isYesterday plugins ([#857](iamkun/dayjs#857)) ([fc08ab6](iamkun/dayjs@fc08ab6))
* Add option callback to Calendar plugin ([#839](iamkun/dayjs#839)) ([b25be90](iamkun/dayjs@b25be90))
* Fix monthsShort for locale fr ([#862](iamkun/dayjs#862)) ([d2de9a0](iamkun/dayjs@d2de9a0))
* Update Breton locale (br) meridiem config ([#856](iamkun/dayjs#856)) ([a2a6672](iamkun/dayjs@a2a6672))
* Update Ukrainian (uk) locale relative time ([#842](iamkun/dayjs#842)) ([578bc1a](iamkun/dayjs@578bc1a))
andrewhood125ruhuc added a commit to andrewhood125ruhuc/SidRH2 that referenced this pull request May 10, 2022
## [1.8.24](iamkun/dayjs@v1.8.23...v1.8.24) (2020-04-10)

### Bug Fixes

* Add config option to RelativeTime plugin ([#851](iamkun/dayjs#851)) ([bd24034](iamkun/dayjs@bd24034))
* add Duration plugin ([#858](iamkun/dayjs#858)) ([d568273](iamkun/dayjs@d568273))
* Add en-in, en-tt locales ([#855](iamkun/dayjs#855)) ([c39fb96](iamkun/dayjs@c39fb96))
* add isToday, isTomorrow, isYesterday plugins ([#857](iamkun/dayjs#857)) ([fc08ab6](iamkun/dayjs@fc08ab6))
* Add option callback to Calendar plugin ([#839](iamkun/dayjs#839)) ([b25be90](iamkun/dayjs@b25be90))
* Fix monthsShort for locale fr ([#862](iamkun/dayjs#862)) ([d2de9a0](iamkun/dayjs@d2de9a0))
* Update Breton locale (br) meridiem config ([#856](iamkun/dayjs#856)) ([a2a6672](iamkun/dayjs@a2a6672))
* Update Ukrainian (uk) locale relative time ([#842](iamkun/dayjs#842)) ([578bc1a](iamkun/dayjs@578bc1a))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants