Too eager date formatting
See original GitHub issueEnv: macOS / Chrome73.0.3683.86
When I try to change only year for some dates, formatting is “too eager”. Is there any way to disable such behaviour?
Demo:
Reproduction
For such date
2019-01-31
When I remove 9
This is the number that will be removed
|
|
|
2019-01-31
I expect numbers below in the input
201-01-31
but I have
2010-12-1
I understand that probably some conversion/date formatting happen like below
201-01-31
2010-13-1 // is trying to format such date but there is no 13th month
2010-12-1 // so it ends up with 2010-12-1
Is there any way to disable that conversion?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:7
- Comments:8
Top Results From Across the Web
How do I read the expiration date?... - Melody Meador Malone
I found this fb page trying to decifer the date AGAIN only to see I was here once already in the past. Your...
Read more >32 First Date Red Flags - First Date Warning Signs
We spoke with 17 experts who revealed 30 red flags that you should look out for on a first date (and that you...
Read more >Yahoo Dating Format And How Do You Recognize It
This are very important question to me and to any relationship before going into it. I want you know if you do believe...
Read more >Dating: Over-Eagerness & Over-Thinking - YouTube
... an email from a viewer who is too over- eager to set the next date ... Paperback $49.99, Hardcover $99.99 and Audio...
Read more >How do I format a Microsoft JSON date? - Stack Overflow
1) Detect Microsoft Date format // Handling of Microsoft AJAX Dates, formatted like '/Date(01238329348239)/' function looksLikeMSDate(s) { return /^\/Date\(/.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks @ahahn95 Finally I didn’t apply the Cleave date formatter, only the generic “blocks” options. The way I render the field, using dayjs, makes the date correct. The update happens via
onBlur
using hook setState. For now is enough good for the customer, but I will try text-mask in the future, looks goodSame issue, resolved by using the custom options. The user can key in any values they want which is fine for us, we’re using another library to validate the date.
var cleave = new Cleave(‘.input-element’, { delimiter: ‘/’, blocks: [2, 2, 2], });
Anyway, Great piece of work cleave.js!