Topic: Problems with setting Calendar plugin's defaultDate property

bernspe priority asked 11 months ago


Expected behavior I am trying to set defaultDate property in order to get the Calendar view navigated to a certain date when showing up. Actual behavior However, can't find a way to do it - as it results in error messages. I have tried moment('12/1/24') and the string itself. Is there a way to set the startup date of the Calendar? Resources (screenshots, code snippets etc.)


Bartosz Cylwik staff answered 11 months ago


Hi! Import dayjs from the mdb-vue-calendar package and use it to set the default date.

import { MDBCalendar, dayjs } from "mdb-vue-calendar";

...

  <MDBCalendar
    ref="basicCalendar"
    :events="basicEvents"
    :defaultDate="dayjs('01/01/2024').format('DD/MM/YYYY')"
  />

Best Regards!



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: Priority
  • Premium support: Yes
  • Technology: MDB Vue
  • MDB Version: MDB5 4.1.1
  • Device: Desktop
  • Browser: Chrome
  • OS: MacOSX
  • Provided sample code: No
  • Provided link: No