question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

regression: on blur date is not formatted

See original GitHub issue

Seems to be a regression from the bug fix to Avoid reformatting user input as they type from 0.44 to 0.46. On blur, date is no longer formatted.

An easy way to test it is to set the date to 4.23.17 and then press tab on the first example.

In version 0.44 the date is formatted correctly (changes to 4/23/17), in version 0.46 it stays as 4.23.17.

Behavior is correct with hash efa7ed but broken at bae0b5.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
obartracommented, May 3, 2017

Hi @aij, thanks for the reply.

I agree that we don’t want to format on the invalid date case. When the date is valid though, as in:

moment('4.23.1778', ['MM/DD/YYYY']).isValid(); // true

I think it makes sense to format it to follow the mask defined.

If this is intentional and 4.23.1778 is not valid for react-datepicker when the mask is MM/DD/YYYY, it may be worth documenting the differences between what moment.js and react-datepicker consider valid. In my opinion, the expected behavior would be to keep them consistent

0reactions
stale[bot]commented, Aug 30, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Html input type date losing value on onfocusout - Stack Overflow
I assume thats why the value is lost. The input value= must be in yyyy-mm-dd format. The displayed format (when type='date') is determined...
Read more >
Lightning:input type="date": how to change the date fomat
NOTE:Also I have used the new <lightning:inputField fieldName="date__c" /> for dates and actually works really nice but date format is a must I ......
Read more >
Format date in regression - Statalist
When I look at my data, the date will be correctly displayed as 2016Q3. However, when using this variable in a regression using...
Read more >
Date Picker - Components - Paste: The Design System for ...
To change the format of the return date value, we recommend using the formatReturnDate() function on the Date Picker's onChange() or onBlur() handler....
Read more >
Editor Inline Datepicker Blur Focus Issue — DataTables forums
Using moment.js for custom time formatting. ... Problem: I hit {enter} on a cell containing a date to bring up the datepicker.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found