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

no second format compatibility problem. #411

Merged
merged 2 commits into from
Feb 4, 2019
Merged

Conversation

AxeMea
Copy link
Contributor

@AxeMea AxeMea commented Nov 17, 2018

The Date Object has some unexpected behaviors on iOS device when the format of input value like YYYY-MM-DD HH:mm ( no second ).

// iOS device
// NaN
new Date('2018-12-12 11:12')

// other device
// right
new Date('2018-12-12 11:12')

The REGEX_PARSE regular expression in dayjs can't match the YYYY-MM-DD HH:mm format as input value. then return new Date(string) directly. so it has the same problem too.

I guess that developers usually use the kind of format data in work.

The unexpected behavior have many potential risks when the data format is unsure or developers don't check it carefully.

I test 'moment.js' too, It behave correctly.

so, it's better if fix it.

thx.

@codecov-io
Copy link

codecov-io commented Nov 17, 2018

Codecov Report

Merging #411 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #411   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          56     56           
  Lines         491    491           
  Branches       76     76           
=====================================
  Hits          491    491
Impacted Files Coverage Δ
src/index.js 100% <ø> (ø) ⬆️
src/constant.js 100% <100%> (ø) ⬆️

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 73eb122...e450e17. Read the comment docs.

@ghost
Copy link

ghost commented Nov 17, 2018

should we also check YYYY-MM-DD HH:mm:ss?

@AxeMea AxeMea changed the title support 'YYYY-MM-DD HH:mm' formation. 'YYYY-MM-DD HH:mm' formation compatibility problem. Nov 18, 2018
@AxeMea AxeMea changed the title 'YYYY-MM-DD HH:mm' formation compatibility problem. 'YYYY-MM-DD HH:mm' format compatibility problem. Nov 18, 2018
@AxeMea AxeMea changed the title 'YYYY-MM-DD HH:mm' format compatibility problem. no second format compatibility problem. Nov 18, 2018
@AxeMea
Copy link
Contributor Author

AxeMea commented Nov 19, 2018

#260

@AxeMea AxeMea closed this Nov 19, 2018
@iamkun iamkun reopened this Feb 3, 2019
@iamkun iamkun merged commit 58a4d78 into iamkun:master Feb 4, 2019
@iamkun
Copy link
Owner

iamkun commented Feb 4, 2019

🎉 This PR is included in version 1.8.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@iamkun iamkun added the released label Feb 4, 2019
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

3 participants