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: fix parse date string error e.g. '2020/9/30' #980

Merged
merged 1 commit into from
Aug 3, 2020
Merged

Conversation

iamkun
Copy link
Owner

@iamkun iamkun commented Aug 3, 2020

fix #979

@codecov
Copy link

codecov bot commented Aug 3, 2020

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff            @@
##               dev      #980   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          170       170           
  Lines         1477      1477           
  Branches       311       311           
=========================================
  Hits          1477      1477           
Impacted Files Coverage Δ
src/constant.js 100.00% <100.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 90c98e4...1fcbda9. Read the comment docs.

@iamkun iamkun merged commit 231790d into dev Aug 3, 2020
iamkun pushed a commit that referenced this pull request Aug 4, 2020
## [1.8.32](v1.8.31...v1.8.32) (2020-08-04)

### Bug Fixes

* Add Experimental Timezone Plugin ([#974](#974)) ([e69caba](e69caba))
* fix parse date string error e.g. '2020/9/30' ([#980](#980)) ([231790d](231790d)), closes [#979](#979)
* update monthDiff function to get more accurate results ([19e8a7f](19e8a7f))
* Update UTC plugin to support keepLocalTime ([#973](#973)) ([9f488e5](9f488e5))
@iamkun
Copy link
Owner Author

iamkun commented Aug 4, 2020

🎉 This PR is included in version 1.8.32 🎉

The release is available on:

Your semantic-release bot 📦🚀

@iamkun iamkun added the released label Aug 4, 2020
@iamkun iamkun deleted the fix/parse-regex branch August 10, 2020 02:49
@yyfearth
Copy link

Still has issue with invalid date string, like dayjs('2020/222') will results 2021-10-02T07:00:00.000Z
Which I expecting it return Invalid Date

@iamkun
Copy link
Owner Author

iamkun commented Sep 10, 2020

@yyfearth

You may specify a boolean for the last argument to use strict parsing. Strict parsing requires that the format and input match exactly, including delimiters.

dayjs('1970-00-00', 'YYYY-MM-DD').isValid() // true
dayjs('1970-00-00', 'YYYY-MM-DD', true).isValid() // false
dayjs('1970-00-00', 'YYYY-MM-DD', 'es', true).isValid() // false

https://day.js.org/docs/en/parse/string-format

andrewhood125ruhuc added a commit to andrewhood125ruhuc/SidRH2 that referenced this pull request May 10, 2022
## [1.8.32](iamkun/dayjs@v1.8.31...v1.8.32) (2020-08-04)

### Bug Fixes

* Add Experimental Timezone Plugin ([#974](iamkun/dayjs#974)) ([e69caba](iamkun/dayjs@e69caba))
* fix parse date string error e.g. '2020/9/30' ([#980](iamkun/dayjs#980)) ([231790d](iamkun/dayjs@231790d)), closes [#979](iamkun/dayjs#979)
* update monthDiff function to get more accurate results ([19e8a7f](iamkun/dayjs@19e8a7f))
* Update UTC plugin to support keepLocalTime ([#973](iamkun/dayjs#973)) ([9f488e5](iamkun/dayjs@9f488e5))
andrewhood125ruhuc added a commit to andrewhood125ruhuc/SidRH2 that referenced this pull request May 10, 2022
## [1.8.32](iamkun/dayjs@v1.8.31...v1.8.32) (2020-08-04)

### Bug Fixes

* Add Experimental Timezone Plugin ([#974](iamkun/dayjs#974)) ([e69caba](iamkun/dayjs@e69caba))
* fix parse date string error e.g. '2020/9/30' ([#980](iamkun/dayjs#980)) ([231790d](iamkun/dayjs@231790d)), closes [#979](iamkun/dayjs#979)
* update monthDiff function to get more accurate results ([19e8a7f](iamkun/dayjs@19e8a7f))
* Update UTC plugin to support keepLocalTime ([#973](iamkun/dayjs#973)) ([9f488e5](iamkun/dayjs@9f488e5))
splashwizard pushed a commit to splashwizard/tracking-time that referenced this pull request Oct 21, 2024
## [1.8.32](iamkun/dayjs@v1.8.31...v1.8.32) (2020-08-04)

### Bug Fixes

* Add Experimental Timezone Plugin ([#974](iamkun/dayjs#974)) ([e69caba](iamkun/dayjs@e69caba))
* fix parse date string error e.g. '2020/9/30' ([#980](iamkun/dayjs#980)) ([231790d](iamkun/dayjs@231790d)), closes [#979](iamkun/dayjs#979)
* update monthDiff function to get more accurate results ([19e8a7f](iamkun/dayjs@19e8a7f))
* Update UTC plugin to support keepLocalTime ([#973](iamkun/dayjs#973)) ([9f488e5](iamkun/dayjs@9f488e5))
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.

parseDate error from recent release.
2 participants