Customize the default months shown?

3 posts, 1 answers
  1. Brian Vallelunga
    Brian Vallelunga avatar
    103 posts
    Member since:
    May 2008

    Posted 03 Dec 2019 Link to this post

    The default state of the multi-view calendar is to pop up with the current month and next month shown by default. For our needs, it would be better to show the previous month and current month by default. Is there a way to accomplish this?
  2. Answer
    Dimiter Topalov
    Admin
    Dimiter Topalov avatar
    1260 posts

    Posted 05 Dec 2019 Link to this post

    Hello Brian,

    The most straight-forward approach would be to set the focusedDate to a value in the previous month, e.g.:

    https://stackblitz.com/edit/angular-7aepxo?file=app/app.component.ts

    A more generic approach would be to set it to a date, calculated as the first of the previous month based on a new Date() (today), e.g.:

    https://stackblitz.com/edit/angular-7aepxo-zbu7pw?file=app/app.component.ts

    I hope this helps.

    Regards,
    Dimiter Topalov
    Progress Telerik

    Get quickly onboarded and successful with your Telerik and Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  3. Brian Vallelunga
    Brian Vallelunga avatar
    103 posts
    Member since:
    May 2008

    Posted 18 Dec 2019 Link to this post

    Thanks, that was very helpful.
Back to Top