Zaid-Ajaj / Fable.React.Flatpickr

Fable binding for react-flatpickr that is ready to use within Elmish applications
https://zaid-ajaj.github.io/Fable.React.Flatpickr/
MIT License
14 stars 6 forks source link

Empty date not possible? #6

Open Jmaharman opened 3 years ago

Jmaharman commented 3 years ago

I'm trying to work out how to provide an empty date to this library.

The only way that I can see of doing that is to write a custom attribute that provides value, and gives it as a formatted string.

I tried to do similar with a Nullable DateTime but Fable doesn't support Nullable (I've just found your issue in Fable for that).

Is there something I am missing, or is that the only way? If so I can make a PR for DateTime option and apply my logic in that overload.

Zaid-Ajaj commented 3 years ago

Hi there @Jmaharman, to be honest, it has been ages since I've touched this code so if you could give it a try it be great! You are saying that it resets the date when the input is an empty string? Then maybe you can add a function that takes DateTime option and pass empty string when None or pass the DateTime instance when it is available, what do you think?

Jmaharman commented 3 years ago

Sorry for the slow reply, been a crazy week. I’ve basically done what you asked above locally, it’ll clone this repo and push my overload when I get a second on the laptop.

Zaid-Ajaj commented 3 years ago

No rush @Jmaharman, I will be happy to merge and publish a new version as soon as it lands :smile: