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: isoWeek plugin type #1177

Merged
merged 1 commit into from
Oct 31, 2020
Merged

Conversation

javier-garcia-meteologica
Copy link
Contributor

Currently isoWeek plugin is excluding week from its units because it's extending from UnitType instead of OpUnitType. This raises typescript errors if the unit is of type "isoWeek" | "week"

const weekFormat = foo ? 'isoWeek' : 'week';
const weekStart = date.startOf('month').startOf(weekFormat);
[tsserver 2769] [E] No overload matches this call.
   Overload 1 of 2, '(unit: ISOUnitType): Dayjs', gave the following error.
     Argument of type '"isoWeek" | "week"' is not assignable to parameter of type 'ISOUnitType'.
       Type '"week"' is not assignable to type 'ISOUnitType'.
   Overload 2 of 2, '(unit: OpUnitType): Dayjs', gave the following error.
     Argument of type '"isoWeek" | "week"' is not assignable to parameter of type 'OpUnitType'.
       Type '"isoWeek"' is not assignable to type 'OpUnitType'.

@codecov
Copy link

codecov bot commented Oct 30, 2020

Codecov Report

Merging #1177 into dev will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##               dev     #1177   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          174       174           
  Lines         1652      1652           
  Branches       374       374           
=========================================
  Hits          1652      1652           

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 fdb09e4...57a1597. Read the comment docs.

@iamkun
Copy link
Owner

iamkun commented Oct 31, 2020

THX

@iamkun iamkun merged commit c3d0436 into iamkun:dev Oct 31, 2020
iamkun pushed a commit that referenced this pull request Nov 5, 2020
## [1.9.5](v1.9.4...v1.9.5) (2020-11-05)

### Bug Fixes

* customParseFormat plugin supports parsing localizedFormats  ([#1110](#1110)) ([402b603](402b603))
* fix customParseFormat plugin parse meridiem bug ([#1169](#1169)) ([9e8f8d9](9e8f8d9)), closes [#1168](#1168)
* fix devHelper error in umd bundle in browser ([#1165](#1165)) ([d11b5ee](d11b5ee))
* fix utc plugin diff bug in DST ([#1171](#1171)) ([f8da3fe](f8da3fe)), closes [#1097](#1097) [#1021](#1021)
* isoWeek plugin type ([#1177](#1177)) ([c3d0436](c3d0436))
* update localeData plugin to support meridiem ([#1174](#1174)) ([fdb09e4](fdb09e4)), closes [#1172](#1172)
* update timezone plugin parse Date instance / timestamp logic & remove useless test ([#1183](#1183)) ([a7f858b](a7f858b))
@iamkun
Copy link
Owner

iamkun commented Nov 5, 2020

🎉 This PR is included in version 1.9.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

@iamkun iamkun added the released label Nov 5, 2020
andrewhood125ruhuc added a commit to andrewhood125ruhuc/SidRH2 that referenced this pull request May 10, 2022
## [1.9.5](iamkun/dayjs@v1.9.4...v1.9.5) (2020-11-05)

### Bug Fixes

* customParseFormat plugin supports parsing localizedFormats  ([#1110](iamkun/dayjs#1110)) ([402b603](iamkun/dayjs@402b603))
* fix customParseFormat plugin parse meridiem bug ([#1169](iamkun/dayjs#1169)) ([9e8f8d9](iamkun/dayjs@9e8f8d9)), closes [#1168](iamkun/dayjs#1168)
* fix devHelper error in umd bundle in browser ([#1165](iamkun/dayjs#1165)) ([d11b5ee](iamkun/dayjs@d11b5ee))
* fix utc plugin diff bug in DST ([#1171](iamkun/dayjs#1171)) ([f8da3fe](iamkun/dayjs@f8da3fe)), closes [#1097](iamkun/dayjs#1097) [#1021](iamkun/dayjs#1021)
* isoWeek plugin type ([#1177](iamkun/dayjs#1177)) ([c3d0436](iamkun/dayjs@c3d0436))
* update localeData plugin to support meridiem ([#1174](iamkun/dayjs#1174)) ([fdb09e4](iamkun/dayjs@fdb09e4)), closes [#1172](iamkun/dayjs#1172)
* update timezone plugin parse Date instance / timestamp logic & remove useless test ([#1183](iamkun/dayjs#1183)) ([a7f858b](iamkun/dayjs@a7f858b))
andrewhood125ruhuc added a commit to andrewhood125ruhuc/SidRH2 that referenced this pull request May 10, 2022
## [1.9.5](iamkun/dayjs@v1.9.4...v1.9.5) (2020-11-05)

### Bug Fixes

* customParseFormat plugin supports parsing localizedFormats  ([#1110](iamkun/dayjs#1110)) ([402b603](iamkun/dayjs@402b603))
* fix customParseFormat plugin parse meridiem bug ([#1169](iamkun/dayjs#1169)) ([9e8f8d9](iamkun/dayjs@9e8f8d9)), closes [#1168](iamkun/dayjs#1168)
* fix devHelper error in umd bundle in browser ([#1165](iamkun/dayjs#1165)) ([d11b5ee](iamkun/dayjs@d11b5ee))
* fix utc plugin diff bug in DST ([#1171](iamkun/dayjs#1171)) ([f8da3fe](iamkun/dayjs@f8da3fe)), closes [#1097](iamkun/dayjs#1097) [#1021](iamkun/dayjs#1021)
* isoWeek plugin type ([#1177](iamkun/dayjs#1177)) ([c3d0436](iamkun/dayjs@c3d0436))
* update localeData plugin to support meridiem ([#1174](iamkun/dayjs#1174)) ([fdb09e4](iamkun/dayjs@fdb09e4)), closes [#1172](iamkun/dayjs#1172)
* update timezone plugin parse Date instance / timestamp logic & remove useless test ([#1183](iamkun/dayjs#1183)) ([a7f858b](iamkun/dayjs@a7f858b))
splashwizard pushed a commit to splashwizard/tracking-time that referenced this pull request Oct 21, 2024
## [1.9.5](iamkun/dayjs@v1.9.4...v1.9.5) (2020-11-05)

### Bug Fixes

* customParseFormat plugin supports parsing localizedFormats  ([#1110](iamkun/dayjs#1110)) ([402b603](iamkun/dayjs@402b603))
* fix customParseFormat plugin parse meridiem bug ([#1169](iamkun/dayjs#1169)) ([9e8f8d9](iamkun/dayjs@9e8f8d9)), closes [#1168](iamkun/dayjs#1168)
* fix devHelper error in umd bundle in browser ([#1165](iamkun/dayjs#1165)) ([d11b5ee](iamkun/dayjs@d11b5ee))
* fix utc plugin diff bug in DST ([#1171](iamkun/dayjs#1171)) ([f8da3fe](iamkun/dayjs@f8da3fe)), closes [#1097](iamkun/dayjs#1097) [#1021](iamkun/dayjs#1021)
* isoWeek plugin type ([#1177](iamkun/dayjs#1177)) ([c3d0436](iamkun/dayjs@c3d0436))
* update localeData plugin to support meridiem ([#1174](iamkun/dayjs#1174)) ([fdb09e4](iamkun/dayjs@fdb09e4)), closes [#1172](iamkun/dayjs#1172)
* update timezone plugin parse Date instance / timestamp logic & remove useless test ([#1183](iamkun/dayjs#1183)) ([a7f858b](iamkun/dayjs@a7f858b))
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