Topic: Datepicker startdate not working
joelgrondrup asked 4 years ago
startDay in Datepicker is not working
const options = { format: 'dd-mm-yyyy', startDay: 1}
const myDatepicker = new mdb.Datepicker(document.getElementById('myDatepicker'), options)
Should start with Monday. But still Sunday is first.
https://mdbootstrap.com/snippets/standard/joelgrondrup/2843408
Andrew Ford pro premium priority answered 4 years ago
HTML:
<div class="form-outline" id="myDatepicker">
<input type="text" class="form-control" id="exampleDatepicker1" />
<label for="exampleDatepicker1" class="form-label">Select a date</label>
</div>
JavaScript:
const options = {
format: 'dd-mm-yyyy',
startDay: 1
}
const myDatepicker = new mdb.Datepicker(document.getElementById('myDatepicker'), options);
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Free
- Premium support: No
- Technology: MDB Standard
- MDB Version: 2.0.0
- Device: Mac
- Browser: Chrome/Safari
- OS: 10.15.7 Catalina
- Provided sample code: No
- Provided link: Yes
Grzegorz Bujański staff commented 4 years ago
look at @Andrew Ford answer. You try get element by id, but you didn't add an id to the element.