svelte-plugins / datepicker

A simple datepicker component designed for Svelte.
https://svelte-plugins.github.io/datepicker
MIT License
54 stars 12 forks source link

🐛 No timepicker is shown if startDate is NULL or undefined. #27

Open cmjoseph07 opened 4 months ago

cmjoseph07 commented 4 months ago

Describe the bug If I have a datepicker component like the example REPL, if I change startDate = new Date() to startDate = NULL and click on the input field, no timepicker is shown. However, I have an action onDayClick so I have to click the input field twice if I want to set something with no initial date.

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Use the timepicker example
  3. Change the startDate to an undefined or NULL value
  4. See that timepicker no longer appears

Expected behavior Expect timepicker to still be there so I can pick time than pick date which has an action on it.

Or could you advise me how to clear formattedStartDate if nothing is selected?

image