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.

Plugin should accept strings and an empty string when no date is provided

See original GitHub issue

First of all, why does the plugin only accept Date objects? I think it would be easier to work with if it accepted date-like strings as well. Check - https://github.com/Hacker0x01/react-datepicker

This comes in handy when there was no date provided. It should default to an empty box with the placeholder and no bugs. Currently its throwing an error -

"Warning: Failed prop type: Invalid prop value of type String supplied to DateInput, expected instance of Date. in DateInput

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
wojtekmajcommented, Dec 10, 2017

Hey @TechyTimo, in v6.5.0:

  • Ability to clear date was added.
  • You can also pass dates as strings.
  • Empty strings and false is now considered an empty value.

Your last comment may be considered a separate ticket 😃 I’m tracking it in #29.

Let me know what you think!

1reaction
MwirabuaTimcommented, Jan 24, 2018

Works nicely. Thanks a lot for this

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is the best way to test for an empty string with jquery-out ...
The accepted answer will fail when you input a 0, however it will work for 1, 2, 3, 4 etc. Isn't if (!a....
Read more >
Understanding Null Versus the Empty String
The value null represents the absence of any object, while the empty string is an object of type String with zero characters.
Read more >
getting Transformation Error while converting empty string to ...
I have a Expression Transformation that converts input string to a date. Input is of format MM/DD/YYYY (from SQLServer source table). Input data...
Read more >
Handle empty strings when migrating from Oracle to PostgreSQL
Handling NVL and COALESCE​​ The COALESCE function works perfectly fine for data types other than strings. This is because strings can accept ......
Read more >
<input type="search"> - HTML: HyperText Markup Language
If no validation constraints are in place for the input (see Validation for more details), the value can be any text string or...
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