Get the first and the last date from visible dates on screen

4 posts, 0 answers
  1. Léocady
    Léocady avatar
    3 posts
    Member since:
    Aug 2016

    Posted 07 Nov Link to this post

    Hi team Telerik. I'm looking for something about the calendar View. In your demo app it is possible to get in week display mode first and last dates of the week  displayed. I want to do same. I want to get the first and the last dates of visible dates on the screen in month display mode. For example, according to the attached screenshot, the first date should be September 25th and the last November 5th, regardless of the month which is active. How can I do this? thanks for your help.
  2. Deyan
    Admin
    Deyan avatar
    2037 posts

    Posted 09 Nov Link to this post

    Hi,

    You can access the cells currently displayed by RadCalendarView using the Scroll Manager API:

    calendarView.scrollManager.currentFragment().rows().get(0)

    What you basically need to do is get the first and the last row in the current calendar fragment and find the first and the last Cell of type Date. You can access the type of the cell by using the getCellType method: 
    calendarView.scrollManager.currentFragment().rows().get(0).getCell(1).getCellType()


    Then, using the getDate() method you can get the date value (as a long).

    Regards,
    Deyan
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. DevCraft banner
  4. Léocady
    Léocady avatar
    3 posts
    Member since:
    Aug 2016

    Posted 11 Nov in reply to Deyan Link to this post

    Thanks. Let me try it and then come back to confirm your suggestion.
  5. Léocady
    Léocady avatar
    3 posts
    Member since:
    Aug 2016

    Posted 11 Nov in reply to Deyan Link to this post

    Hi. I follow your suggestion and it works fine. Thanks
Back to Top
DevCraft banner