-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Added en-gb-locale #478
Conversation
There was a problem hiding this 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
src/locale/en-gb.js
Outdated
import dayjs from 'dayjs' | ||
|
||
const locale = { | ||
name: 'en', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
en-gb
What's the difference between en-gb and built in en locale, please? |
Codecov Report
@@ Coverage Diff @@
## dev #478 +/- ##
===================================
Coverage 100% 100%
===================================
Files 56 57 +1
Lines 496 501 +5
Branches 80 81 +1
===================================
+ Hits 496 501 +5
Continue to review full report at Codecov.
|
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? |
Is |
Yes I believe formats is the only difference |
src/locale/en-gb.js
Outdated
} else if (b === 3) { | ||
output = 'rd' | ||
} | ||
return number + output |
There was a problem hiding this comment.
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
npm run lint first, pls |
LGTM |
## [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))
🎉 This PR is included in version 1.8.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## [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))
## [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))
## [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))
Added a new locale for en-gb that supports the time and date formats.