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

fix lowercase in LocaleData.longDateFormat() #1101

Merged
merged 12 commits into from
Oct 4, 2020
Merged

fix lowercase in LocaleData.longDateFormat() #1101

merged 12 commits into from
Oct 4, 2020

Conversation

xvaara
Copy link
Contributor

@xvaara xvaara commented Oct 1, 2020

LocaleData.longDateFormat() doesn't return anything for lowercase localized formats if they aren't defined in the locale files. this fixes that the same way that it's done in the localizedFormats plugin.

@codecov
Copy link

codecov bot commented Oct 1, 2020

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff            @@
##               dev     #1101   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          172       172           
  Lines         1548      1557    +9     
  Branches       328       330    +2     
=========================================
+ Hits          1548      1557    +9     
Impacted Files Coverage Δ
src/plugin/localeData/index.js 100.00% <100.00%> (ø)
src/plugin/localizedFormat/index.js 100.00% <100.00%> (ø)
src/plugin/duration/index.js 100.00% <0.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 16937d1...9dffb35. Read the comment docs.

@iamkun
Copy link
Owner

iamkun commented Oct 2, 2020

Should we take this #1106 into consideration as well?

* upstream/fix/objectSupport-utc:
  fix: fix objectSupport plugin bug in utc
  fix: update localeData plugin to add longDateFormat to global localeData (#1106)
  fix: export type of duration plugin (#1094)
@xvaara
Copy link
Contributor Author

xvaara commented Oct 2, 2020

I added the same to global object. I think I merged my branch on the wrong commit, sorry about that...

* 'dev' of https://github.com/xvaara/dayjs:
  add lowercase localizedFormat to glocal localeData
  export t to localeData from localizedFormat
  fix: fix objectSupport plugin bug in utc
  fix lowercase in LocaleData.longDateFormat()
@xvaara xvaara requested a review from iamkun October 2, 2020 09:22
@@ -23,7 +29,8 @@ export default (o, c, dayjs) => { // locale needed later
(instance ? instance.format('dd') : getShort(this, 'weekdaysMin', 'weekdays', 2)),
weekdaysShort: instance =>
(instance ? instance.format('ddd') : getShort(this, 'weekdaysShort', 'weekdays', 3)),
longDateFormat: format => this.$locale().formats[format]
longDateFormat: format => getLongDateFormat(format)
Copy link
Owner

Choose a reason for hiding this comment

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

we should pass instance locale, right? this.$locale()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added those to the function.

@iamkun iamkun merged commit 7937ccd into iamkun:dev Oct 4, 2020
iamkun pushed a commit that referenced this pull request Oct 13, 2020
## [1.9.2](v1.9.1...v1.9.2) (2020-10-13)

### Bug Fixes

* add arraySupport plugin ([#1129](#1129)) ([be505c2](be505c2))
* export type of duration plugin ([#1094](#1094)) ([2c92e71](2c92e71))
* Fix LocaleData plugin longDateFormat lowercase error ([#1101](#1101)) ([7937ccd](7937ccd))
* Fix objectSupport plugin bug in UTC ([#1107](#1107)) ([fe90bb6](fe90bb6)), closes [#1105](#1105)
* fix Serbian locale grammar (sr, sr-cyrl) ([#1108](#1108)) ([cc87eff](cc87eff))
* Fix typo for "monday" in arabic ([#1067](#1067)) ([2e1e426](2e1e426))
* support dayjs.add(Duration), dayjs.subtract(Duration) ([#1099](#1099)) ([b1a0294](b1a0294))
* update Breton [br] locale relativeTime config ([#1103](#1103)) ([b038bfd](b038bfd))
* update Catalan [ca] locale ordinal ([73da380](73da380))
* update German [de] locale relativeTime config ([#1109](#1109)) ([f6e771b](f6e771b))
* update localeData plugin to add longDateFormat to global localeData ([#1106](#1106)) ([16937d1](16937d1))
* Update objectSupport plugin to return current date time while parsing empty object ([f56783e](f56783e))
@iamkun
Copy link
Owner

iamkun commented Oct 13, 2020

🎉 This PR is included in version 1.9.2 🎉

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.9.2](iamkun/dayjs@v1.9.1...v1.9.2) (2020-10-13)

### Bug Fixes

* add arraySupport plugin ([#1129](iamkun/dayjs#1129)) ([be505c2](iamkun/dayjs@be505c2))
* export type of duration plugin ([#1094](iamkun/dayjs#1094)) ([2c92e71](iamkun/dayjs@2c92e71))
* Fix LocaleData plugin longDateFormat lowercase error ([#1101](iamkun/dayjs#1101)) ([7937ccd](iamkun/dayjs@7937ccd))
* Fix objectSupport plugin bug in UTC ([#1107](iamkun/dayjs#1107)) ([fe90bb6](iamkun/dayjs@fe90bb6)), closes [#1105](iamkun/dayjs#1105)
* fix Serbian locale grammar (sr, sr-cyrl) ([#1108](iamkun/dayjs#1108)) ([cc87eff](iamkun/dayjs@cc87eff))
* Fix typo for "monday" in arabic ([#1067](iamkun/dayjs#1067)) ([2e1e426](iamkun/dayjs@2e1e426))
* support dayjs.add(Duration), dayjs.subtract(Duration) ([#1099](iamkun/dayjs#1099)) ([b1a0294](iamkun/dayjs@b1a0294))
* update Breton [br] locale relativeTime config ([#1103](iamkun/dayjs#1103)) ([b038bfd](iamkun/dayjs@b038bfd))
* update Catalan [ca] locale ordinal ([73da380](iamkun/dayjs@73da380))
* update German [de] locale relativeTime config ([#1109](iamkun/dayjs#1109)) ([f6e771b](iamkun/dayjs@f6e771b))
* update localeData plugin to add longDateFormat to global localeData ([#1106](iamkun/dayjs#1106)) ([16937d1](iamkun/dayjs@16937d1))
* Update objectSupport plugin to return current date time while parsing empty object ([f56783e](iamkun/dayjs@f56783e))
andrewhood125ruhuc added a commit to andrewhood125ruhuc/SidRH2 that referenced this pull request May 10, 2022
## [1.9.2](iamkun/dayjs@v1.9.1...v1.9.2) (2020-10-13)

### Bug Fixes

* add arraySupport plugin ([#1129](iamkun/dayjs#1129)) ([be505c2](iamkun/dayjs@be505c2))
* export type of duration plugin ([#1094](iamkun/dayjs#1094)) ([2c92e71](iamkun/dayjs@2c92e71))
* Fix LocaleData plugin longDateFormat lowercase error ([#1101](iamkun/dayjs#1101)) ([7937ccd](iamkun/dayjs@7937ccd))
* Fix objectSupport plugin bug in UTC ([#1107](iamkun/dayjs#1107)) ([fe90bb6](iamkun/dayjs@fe90bb6)), closes [#1105](iamkun/dayjs#1105)
* fix Serbian locale grammar (sr, sr-cyrl) ([#1108](iamkun/dayjs#1108)) ([cc87eff](iamkun/dayjs@cc87eff))
* Fix typo for "monday" in arabic ([#1067](iamkun/dayjs#1067)) ([2e1e426](iamkun/dayjs@2e1e426))
* support dayjs.add(Duration), dayjs.subtract(Duration) ([#1099](iamkun/dayjs#1099)) ([b1a0294](iamkun/dayjs@b1a0294))
* update Breton [br] locale relativeTime config ([#1103](iamkun/dayjs#1103)) ([b038bfd](iamkun/dayjs@b038bfd))
* update Catalan [ca] locale ordinal ([73da380](iamkun/dayjs@73da380))
* update German [de] locale relativeTime config ([#1109](iamkun/dayjs#1109)) ([f6e771b](iamkun/dayjs@f6e771b))
* update localeData plugin to add longDateFormat to global localeData ([#1106](iamkun/dayjs#1106)) ([16937d1](iamkun/dayjs@16937d1))
* Update objectSupport plugin to return current date time while parsing empty object ([f56783e](iamkun/dayjs@f56783e))
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.

None yet

2 participants