Holiday Notice: Support will be provided on a limited scale from December 24th, 2024, to January 2nd, 2025. Happy holidays and a wonderful New Year!


Topic: Datepicker startdate not working

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


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.


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


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

  • ForumUser: 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