Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Calendar
  New Posts New Posts RSS Feed - Holidays in Calendar
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Holidays in Calendar

 Post Reply Post Reply
Author
Message
HansN View Drop Down
Newbie
Newbie


Joined: 06 August 2007
Location: Austria
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote HansN Quote  Post ReplyReply Direct Link To This Post Topic: Holidays in Calendar
    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


Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
HansN View Drop Down
Newbie
Newbie


Joined: 06 August 2007
Location: Austria
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote HansN Quote  Post ReplyReply Direct Link To This Post 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



Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.202 seconds.