B
B
BonBon Slick2017-06-11 18:13:14
Node.js
BonBon Slick, 2017-06-11 18:13:14

Bootstrap 4, disable past dates for input type date?

Bootstrap 4

// HTML
  <input class="form-control" type="datetime-local">

//JS - в старом делал примерно так
 var nowDate = new Date();
            var today = new Date(nowDate.getFullYear(), nowDate.getMonth(), nowDate.getDate(), 0, 0, 0, 0);
            $('#date').datepicker({
                startDate: today
            });


How to disable past dates in BS 4?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Q
qq1, 2018-10-18
@dmc1989

What is your backend written in? You need to add support for CORS, google on request %backend% enable CORS
If on express, then here https://github.com/expressjs/cors

A
Alexey Sklyarov, 2017-06-11
@BonBonSlick

Using search is sometimes very useful: https://stackoverflow.com/questions/16123056/boots...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question