Dayjs: YYYY-MM-DD Format Not Working

Created on 2 Apr 2019  路  6Comments  路  Source: iamkun/dayjs


Issuehunt badges

Describe the bug
When passing in a parse format of YYYY-MM-DD with an invalid date string of 10/12/2014, should result in and invalid date but instead resolves to 08-14-2015

Expected behavior
Should result in date.isValid() === false

Information

  • Day.js Version [e.g. v1.8.11]
  • OS: [e.g. MacOS]
  • Browser [e.g. chrome 73]

CodeSandbox Link




IssueHunt Summary

iamkun iamkun has been rewarded.

Backers (Total: $50.00)

- #517 fix: Add UTC mode with UTC plugin

Tips

IssueHunt has been backed by the following sponsors. Become a sponsor


Rewarded on Issuehunt released 鈽笍Bug

Most helpful comment

will fix soon

All 6 comments

With customParseFormat plugin
dayjs('2014-12-01', 'YYYY-MM-DD').toISOString() returns 2014-12-01T00:00:00.000Z

Looks good.

@xxyuk Right sorry, I updated my issue comments. If you check the codesandbox it should be throwing an error when trying to parse the invalid date format but instead parses to a random date.

will fix soon

@issuehunt has funded $50.00 to this issue.


:tada: This issue has been resolved in version 1.8.13 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

@iamkun has rewarded $45.00 to @iamkun. See it on IssueHunt

  • :moneybag: Total deposit: $50.00
  • :tada: Repository reward(0%): $0.00
  • :wrench: Service fee(10%): $5.00
Was this page helpful?
0 / 5 - 0 ratings

Related issues

dakshshah96 picture dakshshah96  路  5Comments

fundon picture fundon  路  5Comments

LauRocky picture LauRocky  路  5Comments

vaquel picture vaquel  路  3Comments

paraself picture paraself  路  3Comments