This is a migrated thread and some comments may be shown as answers.

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

3 Answers 114 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Léocady
Top achievements
Rank 1
Léocady asked on 07 Nov 2016, 12:58 PM
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.

3 Answers, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 09 Nov 2016, 03:01 PM
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
0
Léocady
Top achievements
Rank 1
answered on 11 Nov 2016, 09:56 AM
Thanks. Let me try it and then come back to confirm your suggestion.
0
Léocady
Top achievements
Rank 1
answered on 11 Nov 2016, 04:12 PM
Hi. I follow your suggestion and it works fine. Thanks
Tags
Calendar
Asked by
Léocady
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Léocady
Top achievements
Rank 1
Share this question
or