jannicz / appointment-picker

Appointment Picker - a tiny JavaScript timepicker that helps you pick appointments

Home Page:https://jannicz.github.io/appointment-picker/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

only allowed dates?

mtness opened this issue · comments

commented

As it seems timeslot are created programmatically via min/max, start/end and disabled dates -

But I have an array here which contains only the available start times of a timeslot.
(the length of a slot is defined.)

Would it be possible to pass this array to to th picker somehow?

Thank you in advance and best Regards, MT

If i understand right, you have predefined timeslots of various length like [11:00-11:25, 12:05-12:33, etc.]? This will not work, the timepicker must have a fixed interval. The timeslots must be of same length.

An approach could be, to round your timeslots to the closest interval. Then write a mapping function that creates the disabled array for the picker configuration so that all other times cannot be picked. You can think about that.

commented

Hi jannicz, thank you for your quick comment!
no - the length of the slots is not various - they all should have the same time.
Yes, In fact i have thought about negating the array to achieve the desired result - that should do the trick.
i was just wondering if there was an "enabled" - option.

Tell me if your idea of 'negation' worked. I will close this issue now.