Print Page | Close Window

Holidays in Calendar

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Calendar
Forum Description: Topics Related to Codejock Calendar
URL: http://forum.codejock.com/forum_posts.asp?TID=8775
Printed Date: 07 October 2024 at 1:24pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Holidays in Calendar
Posted By: HansN
Subject: Holidays in Calendar
Date Posted: 14 November 2007 at 3:50am
Hello !

In the Calendar sample application it is shown how easy it is to create recurrent events.

I would like to adapt the Calendar to take holidays into account. This means to include holidays into the recurrence, e.g. this event happens on Sundyas and holidays within 30 days, and to exclude holidays from the recurrence, e.g. this event happens within 30 days, but not on holidays.

The holidays will be predefined in a collection.

Unfortunatly I did not find a way to adapt the recurrence pattern or to control the generation of recurrences  that way.

Does anybody have an idea how to do that ?

Thanks in advance

HansN





Replies:
Posted By: sserge
Date Posted: 19 November 2007 at 5:50pm
Hi,

You can create a regular daily pattern for 30 days, and handle PrePopulate event. There you can verify whether a current day for an occurrence does exists in your holidays' collection, and remove it if necessary.

--
WBR,
Serge


Posted By: HansN
Date Posted: 21 November 2007 at 3:04am
Thanks for the tip.

I implemented it that way and it worked fine.  But the datepicker control did not checked that there were no events any more, so I used the DayMetrics event of datepicker to change color of holidays to red. I also changed the header color of holidays to red in day, week and month view and it worked fine.

There is still the problem that I need to add holidays events to the occurrence.

Is there a chance to get the calculated end time of an occurence ?

If I have start and end time I can check for holidays in that time range and add some new events. Of course I will "link" them to the master event by a custom property, e.g. by saving the event IDs in a list.

WBR,

HansN






Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net