Print Page | Close Window

Add Holidays to 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=3434
Printed Date: 27 April 2024 at 4:23pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Add Holidays to Calendar
Posted By: dentor
Subject: Add Holidays to Calendar
Date Posted: 22 December 2005 at 3:24am
Is there a way to add holidays to the Xtreme Calendar control, to display a different color for that days when displaying the day or WorkWeek, the same way as 'WorkDayStartTime' does ?
 
Eventually, a different color to display lunch time ?
 
Thanks for your reply. 



Replies:
Posted By: kylechen
Date Posted: 24 December 2005 at 12:03am
Same question here too. Thanks


Posted By: sserge
Date Posted: 24 December 2005 at 11:18am
Hello,

Currently there are only 2 ways to define work time for the Calendar control: using DayStartTime / DayEndTime properties and using WorkWeekMask property. First pair allows controlling work time during the day, and the second one – for days of the week.

So, unfortunately you can not control a lunch time. We’ll consider those as a feature requests for the next version.

Currently I can propose only 1 workaround for controlling work/non work days like holidays. The idea is that if you have shown no more than 1 week in day view, you can capture days selection changed event and adjust WorkWeekMask property according to days on the current week  Something like the following:


Private Sub CalendarControl_SelectionChanged(ByVal SelType As  XtremeCalendarControl.CalendarSelectionChanged)
    If SelType = xtpCalendarSelectionDays Then
        ...
        CalendarControl.Options.WorkWeekMask = xtpCalendarDaySunday
        For i = 0 To DaysCount
             If CalendarControl.ActiveView.Days(i).Date = CheckedDate Then
                 CalendarControl.Options.WorkWeekMask = CalendarControl.Options.WorkWeekMask Or xtpCalendarDayWednesday
    ...




Or, if you are using C++/MFC version of the control, you can override  IsWorkDateTime method, and that would solve both problems.

--
WBR,
Serge


Posted By: kylechen
Date Posted: 24 December 2005 at 8:43pm

Thank you sserge. I understand your explaination and workaround solution. However I actually need is a "highlight" of holidays (not only in day week view but also in month view, etc.) or lunch time. Even more some cusotmized icon could be displayed for special days like a bell for Xmas Day. I believe this has not been implemented in ActiveX version yet. Just wish it be done next release.

Thank you anyway.




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