Topic: Datepicker startdate not working

joelgrondrup free asked 2 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


Grzegorz Bujański staff commented 2 years ago

look at @Andrew Ford answer. You try get element by id, but you didn't add an id to the element.


Andrew Ford priority answered 2 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);


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • 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