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

Typescript definition allows quarter as unit of time #531

Closed
choffmeister opened this issue Mar 12, 2019 · 3 comments
Closed

Typescript definition allows quarter as unit of time #531

choffmeister opened this issue Mar 12, 2019 · 3 comments
Labels
☢️Bug Something isn't working released

Comments

@choffmeister
Copy link

Describe the bug

According to the typescript definition, this is valid:

val now = dayjs()
val nextQuarter = now.add(1, 'quarter')

now.valueOf() == nextQuarter.valueOf() // true

Expected behavior
Either the quarter calculation should work or the typescript definition should not allow passing 'quarter' as unit of time.

Information

  • Day.js Version: 1.8.10
@iamkun
Copy link
Owner

iamkun commented Mar 12, 2019

Thanks, will fix soon

@iamkun iamkun added the ☢️Bug Something isn't working label Mar 12, 2019
@iamkun iamkun closed this as completed in 22a249c Mar 12, 2019
iamkun pushed a commit that referenced this issue Mar 21, 2019
## [1.8.11](v1.8.10...v1.8.11) (2019-03-21)

### Bug Fixes

* Add .add('quarter') .startOf('quarter') through plugin quarterOfYear ([dde39e9](dde39e9)), closes [#537](#537) [#531](#531)
* Add locale support for Azerbaijani language (az) ([#535](#535)) ([eeb20fa](eeb20fa))
* Correct typescript definition `add` ([22a249c](22a249c)), closes [#531](#531)
* Fix CustomParseFormat plugin formatting bug ([#536](#536)) ([8578546](8578546)), closes [#533](#533)
* Update pt locale ([#538](#538)) ([1ac9e1e](1ac9e1e))
@iamkun
Copy link
Owner

iamkun commented Mar 21, 2019

🎉 This issue has been resolved in version 1.8.11 🎉

The release is available on:

Your semantic-release bot 📦🚀

@iamkun
Copy link
Owner

iamkun commented Mar 21, 2019

Please use our QuarterOfYear plugin to get full quarter support after version 1.8.11.

import quarterOfYear from 'dayjs/plugin/quarterOfYear'

dayjs.extend(quarterOfYear)

dayjs().startOf('quarter') 
dayjs().add(1, 'quarter')

https://github.com/iamkun/dayjs/blob/dev/docs/en/Plugin.md#quarterofyear

andrewhood125ruhuc added a commit to andrewhood125ruhuc/SidRH2 that referenced this issue May 10, 2022
## [1.8.11](iamkun/dayjs@v1.8.10...v1.8.11) (2019-03-21)

### Bug Fixes

* Add .add('quarter') .startOf('quarter') through plugin quarterOfYear ([dde39e9](iamkun/dayjs@dde39e9)), closes [#537](iamkun/dayjs#537) [#531](iamkun/dayjs#531)
* Add locale support for Azerbaijani language (az) ([#535](iamkun/dayjs#535)) ([eeb20fa](iamkun/dayjs@eeb20fa))
* Correct typescript definition `add` ([22a249c](iamkun/dayjs@22a249c)), closes [#531](iamkun/dayjs#531)
* Fix CustomParseFormat plugin formatting bug ([#536](iamkun/dayjs#536)) ([8578546](iamkun/dayjs@8578546)), closes [#533](iamkun/dayjs#533)
* Update pt locale ([#538](iamkun/dayjs#538)) ([1ac9e1e](iamkun/dayjs@1ac9e1e))
andrewhood125ruhuc added a commit to andrewhood125ruhuc/SidRH2 that referenced this issue May 10, 2022
## [1.8.11](iamkun/dayjs@v1.8.10...v1.8.11) (2019-03-21)

### Bug Fixes

* Add .add('quarter') .startOf('quarter') through plugin quarterOfYear ([dde39e9](iamkun/dayjs@dde39e9)), closes [#537](iamkun/dayjs#537) [#531](iamkun/dayjs#531)
* Add locale support for Azerbaijani language (az) ([#535](iamkun/dayjs#535)) ([eeb20fa](iamkun/dayjs@eeb20fa))
* Correct typescript definition `add` ([22a249c](iamkun/dayjs@22a249c)), closes [#531](iamkun/dayjs#531)
* Fix CustomParseFormat plugin formatting bug ([#536](iamkun/dayjs#536)) ([8578546](iamkun/dayjs@8578546)), closes [#533](iamkun/dayjs#533)
* Update pt locale ([#538](iamkun/dayjs#538)) ([1ac9e1e](iamkun/dayjs@1ac9e1e))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
☢️Bug Something isn't working released
Projects
None yet
Development

No branches or pull requests

2 participants