T
T
TheMoth2018-04-26 08:56:30
JavaScript
TheMoth, 2018-04-26 08:56:30

How would you implement range for the DatePicker component?

I am making my own custom DatePicker, there was a need to make a range of dates so that I could select several dates on one calendar. How would you implement this? I have only this idea so far:
Create a range array that stores two values: startDate and endDate and an integer property step.
When the first date is selected, step is incremented by one, the startDate value is initialized, on the second click, step is incremented by one again and the endDate value is initialized. Is this a normal approach or is there another way?
How to store intermediate dates that are between startDate and endDate? (to be able to customize them)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
lavezzi1, 2018-04-26
@lavezzi1

https://github.com/vuejs/awesome-vue#date-picker

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question