Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic establish an end date of the calendar (Read 1976 times)
annievalki
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 4
Joined: May 26th, 2020
establish an end date of the calendar
May 26th, 2020 at 10:43pm
Print Post  
Hello I have the one idea of creating a Calendar, when you create it you can introduce the last month/year that I want in my calendar.
My intentions was of using the SingleMonth view, but whet you reach f.e June/2020 (which was set like last month) you cannot advance to July/2020.

But I dont know if there exist a method for something like this. Any idea?
  
Back to top
 
IP Logged
 
Iva_P
YaBB Moderator
*****
Offline


I Love MindFusion!

Posts: 41
Joined: Jun 19th, 2013
Re: establish an end date of the calendar
Reply #1 - May 27th, 2020 at 9:33am
Print Post  
Hello,
You can achieve this effect by handling the visibleDateChanged event and checking of the "newDate" to be rendered is already in the date range that you do not want to show therefore the action must be stopped:

Code (Java)
Select All
calendar.addCalendarListener(new CalendarAdapter()
	{
		@Override()
		public void visibleDateChanged(DateChangedEvent e) {
			onVisibleDateChanged(e);
		}
	});
..................

//make sure that dates are rendered till the end of May
public void onVisibleDateChanged(DateChangedEvent e)
{

	if(e.getNewDate().getMonth() == 6)
	{
		calendar.setDate(new DateTime(2020, 5, 31));
	}
}
 

  
Back to top
 
IP Logged
 
annievalki
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 4
Joined: May 26th, 2020
Re: establish an end date of the calendar
Reply #2 - May 27th, 2020 at 10:43pm
Print Post  
Thank you very much <3 Grin Grin
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint