simplepicker icon indicating copy to clipboard operation
simplepicker copied to clipboard

Make Previous dates disabled

Open adrshk opened this issue 5 years ago • 4 comments

There should be a flag to disable the selection of previous dates.

For example, if today is 03 Nov 2018 then one should not be able to select the date previous than 3rd Nov.

thanks.

adrshk avatar Nov 03 '18 15:11 adrshk

Agreed, I will work on it @adrshk!

priyank-p avatar Nov 03 '18 16:11 priyank-p

Unfortunately, I don't have time to work on this currently! I can start working on it this weekend (This is on my todolist).

(@adrshk this should be hard to implement, so if you could work on it and create a PR I can merge and create a new release.)

priyank-p avatar Nov 05 '18 19:11 priyank-p

Can you suggest where in the code would be a good place to add support for enabling a selected range of dates? For example, other date-picker libraries allow configuring either a start date or end date or both. I scanned index.ts but didn't spot an obvious place to insert enforcement of such config.

(Similarly, is there a way to configure a default time? And where can one provide localized strings for month names?)

David-dp- avatar Sep 16 '21 03:09 David-dp-

@David-dp- The render method in the index.ts is the main place where rendering happens. But, for what you are trying to do, you need to update the scrape methods in date-util.ts to support ranges. If you want to work on providing an API for month names date-util.ts is also the place.

For passing the default time, the selectedDate option should work.

priyank-p avatar Sep 17 '21 17:09 priyank-p