L
L
ligisayan2019-03-22 15:09:33
JavaScript
ligisayan, 2019-03-22 15:09:33

How to set datapicker value several days after an arbitrary date?

Hello!
There is a calendar with datapicker library under bootstrap 4 with start and end position values.

The task is to be able to choose only a date starting from today for the start, and for the finish no earlier than 4 days after the start. To do this, I try to do this, but I get an error:

var d = e.date + 86400000*4;
$('#datetimepicker3').datetimepicker('minDate', d);

TypeError: minDate() Could not parse date parameter: 1553288400000



UPD: Setting the minimum start day is solved by setting the minDate: moment() parameter , but if you start choosing the end day first, you can still select the days that have already passed, and if you set minDate: moment() to the end day , then immediately in the start You can only choose from today.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2019-03-22
@ligisayan

Replace with
new Date(e.date + 86400000 * 4)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question