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

Added en-gb-locale #478

Merged
merged 7 commits into from
Feb 7, 2019
Merged

Added en-gb-locale #478

merged 7 commits into from
Feb 7, 2019

Conversation

tcrands
Copy link
Contributor

@tcrands tcrands commented Feb 5, 2019

Added a new locale for en-gb that supports the time and date formats.

Copy link
Owner

@iamkun iamkun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You cloud also add weekStart config

import dayjs from 'dayjs'

const locale = {
name: 'en',
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

en-gb

@iamkun
Copy link
Owner

iamkun commented Feb 5, 2019

What's the difference between en-gb and built in en locale, please?

@codecov-io
Copy link

codecov-io commented Feb 5, 2019

Codecov Report

Merging #478 into dev will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@         Coverage Diff         @@
##            dev   #478   +/-   ##
===================================
  Coverage   100%   100%           
===================================
  Files        56     57    +1     
  Lines       496    501    +5     
  Branches     80     81    +1     
===================================
+ Hits        496    501    +5
Impacted Files Coverage Δ
src/locale/en-gb.js 100% <100%> (ø)

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 ca49e7c...f77b4ce. Read the comment docs.

@tcrands
Copy link
Contributor Author

tcrands commented Feb 5, 2019

The difference is the time and data formats. It says the built in en locale is US so this won't work for the UK.

Alternatively we could make the default en locale UK based?

@iamkun
Copy link
Owner

iamkun commented Feb 5, 2019

Is formats the only different part?

@tcrands
Copy link
Contributor Author

tcrands commented Feb 5, 2019

Yes I believe formats is the only difference

} else if (b === 3) {
output = 'rd'
}
return number + output
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ordinal = (number) => {
const s = ['th', 'st', 'nd', 'rd']
const v = number % 100
return [${number}${(s[(v - 20) % 10] || s[v] || s[0])}]
}

This looks better

@iamkun
Copy link
Owner

iamkun commented Feb 5, 2019

npm run lint first, pls

@ghost
Copy link

ghost commented Feb 5, 2019

LGTM

@iamkun iamkun merged commit 508c3a7 into iamkun:dev Feb 7, 2019
iamkun pushed a commit that referenced this pull request Feb 7, 2019
## [1.8.5](v1.8.4...v1.8.5) (2019-02-07)

### Bug Fixes

* Add en-gb locale ([#478](#478)) ([508c3a7](508c3a7))
* **module:** transpile everything except ES6 modules in the 'module' entrypoint ([#477](#477)) ([#480](#480)) ([#482](#482)) ([767017d](767017d))
* update customParseFormat plugin support hh:mm ([54947cc](54947cc)), closes [#484](#484)
* Update module in package.json ([5c5a7a0](5c5a7a0))
@iamkun
Copy link
Owner

iamkun commented Feb 7, 2019

🎉 This PR is included in version 1.8.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

@iamkun iamkun added the released label Feb 7, 2019
andrewhood125ruhuc added a commit to andrewhood125ruhuc/SidRH2 that referenced this pull request May 10, 2022
## [1.8.5](iamkun/dayjs@v1.8.4...v1.8.5) (2019-02-07)

### Bug Fixes

* Add en-gb locale ([#478](iamkun/dayjs#478)) ([508c3a7](iamkun/dayjs@508c3a7))
* **module:** transpile everything except ES6 modules in the 'module' entrypoint ([#477](iamkun/dayjs#477)) ([#480](iamkun/dayjs#480)) ([#482](iamkun/dayjs#482)) ([767017d](iamkun/dayjs@767017d))
* update customParseFormat plugin support hh:mm ([54947cc](iamkun/dayjs@54947cc)), closes [#484](iamkun/dayjs#484)
* Update module in package.json ([5c5a7a0](iamkun/dayjs@5c5a7a0))
andrewhood125ruhuc added a commit to andrewhood125ruhuc/SidRH2 that referenced this pull request May 10, 2022
## [1.8.5](iamkun/dayjs@v1.8.4...v1.8.5) (2019-02-07)

### Bug Fixes

* Add en-gb locale ([#478](iamkun/dayjs#478)) ([508c3a7](iamkun/dayjs@508c3a7))
* **module:** transpile everything except ES6 modules in the 'module' entrypoint ([#477](iamkun/dayjs#477)) ([#480](iamkun/dayjs#480)) ([#482](iamkun/dayjs#482)) ([767017d](iamkun/dayjs@767017d))
* update customParseFormat plugin support hh:mm ([54947cc](iamkun/dayjs@54947cc)), closes [#484](iamkun/dayjs#484)
* Update module in package.json ([5c5a7a0](iamkun/dayjs@5c5a7a0))
splashwizard pushed a commit to splashwizard/tracking-time that referenced this pull request Oct 21, 2024
## [1.8.5](iamkun/dayjs@v1.8.4...v1.8.5) (2019-02-07)

### Bug Fixes

* Add en-gb locale ([#478](iamkun/dayjs#478)) ([508c3a7](iamkun/dayjs@508c3a7))
* **module:** transpile everything except ES6 modules in the 'module' entrypoint ([#477](iamkun/dayjs#477)) ([#480](iamkun/dayjs#480)) ([#482](iamkun/dayjs#482)) ([767017d](iamkun/dayjs@767017d))
* update customParseFormat plugin support hh:mm ([54947cc](iamkun/dayjs@54947cc)), closes [#484](iamkun/dayjs#484)
* Update module in package.json ([5c5a7a0](iamkun/dayjs@5c5a7a0))
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.

3 participants