|
CalendarXP.net Support Most forums here are private and invisible to public.
|
View previous topic :: View next topic |
Author |
Message |
gflou
Joined: 03 May 2005 Posts: 3
|
Posted: Tue May 03, 2005 11:01 pm Post subject: How to set the calendar to keep an event date its own style even if the event date is an out-of-range or disabled date? |
|
|
Hi,
For the out-of-range dates I use a special style as it has already been described at the FAQ section. I also use different style for the event dates. If an event date becomes an out-of-range date then the out-of-range style prevails. How to make the out-of-range event date to keep its own style?
|
|
Back to top |
|
|
calendarxp Site Admin
Joined: 30 Jan 2005 Posts: 409
|
Posted: Wed May 04, 2005 12:52 am Post subject: |
|
|
Well, by default the out-of-range style gets higher priority - which is more logical. But if you really want to change, you can redefine the fGetAgenda() in plugins.js:
Code: | function fGetAgenda(y,m,d,taint) {
var s=fCalibrate(y,m),cm=gCurMonth;
var def=["",gsAction,gcCellBG,null,guCellBGImg,false,gsCellHTML];
if (taint) if ((giShowOther&4)&&(s[0]<cm[0]||s[0]==cm[0]&&s[1]<cm[1])||(giShowOther&8)&&(s[0]>cm[0]||s[0]==cm[0]&&s[1]>cm[1]))
return null;
var ag=fHoliday?fHoliday(s[0],s[1],d):fGetEvent(y,m,d);
if (ag==null) ag=def;
else {
for (var i=0;i<7;i++) {
if (gAgendaMask[i]!=-1) ag[i]=gAgendaMask[i];
if (ag[i]==null&&i!=1) ag[i]=def[i];
}
if (taint&&s[1]!=cm[1]&&!(giShowOther&1)) {
def[0]=ag[0]; def[1]=ag[1]; ag=null; ag=def;
}
}
if (taint&&s[1]!=cm[1]) {
if (gcOtherDayBG&&ag[2]==gcCellBG) ag[2]=gcOtherDayBG;
ag[3]=gcOtherDay;
}
if (!fValidRange(s[0],s[1],d)) {
ag[1]=null;
if (!ag[0]) ag[0]=gsOutOfRange;
if (!ag[4]&&guOutOfRange) ag[4]=guOutOfRange;
}
return ag;
} |
It will override the original fGetAgenda() in the calendar engine. Note the change we made to the last 3 lines before "return ag;" - we now choose not to change ag[0] and/or ag[4] if they already had a value assigned. However, we still need to make ag[1] a null value so as to prevent user from selecting the out-of-range dates.
_________________ Copyright 2003-2011 Idemfactor Solutions, Inc. All rights reserved. |
|
Back to top |
|
|
gflou
Joined: 03 May 2005 Posts: 3
|
Posted: Wed May 04, 2005 9:01 pm Post subject: disabled dates style against event dates style |
|
|
Thank you very much for your prompt reply but it still doesn' work. The calendar settings are as follows:
gcCellBG="white"
gAgendaMask=[-1,-1,gcCellBG,-1,-1,false,null]
For all out-of-range dates I use the following style declared inside the fHoliday function:
if (!fValidRange(y,m,d)) return [gsOutOfRange,null,"","red",guOutOfRange,null];
I dynamically add events with their own style:
if(self.gfPop)gfPop.fAddEvent(y,m,d," Arrival Date ",null,"","white","selecteda.gif");
When I call the fPopCalendar I pass RangeBeginDate and RangeEndDate values and with this way some of the event dates become disabled dates and they don't maintain their own style but they get the style of the out-of-range dates while I still want them to maintain their style.
I know it is complicated, but any suggestion would be of great help.
Thank you in advance.
|
|
Back to top |
|
|
calendarxp Site Admin
Joined: 30 Jan 2005 Posts: 409
|
Posted: Wed May 04, 2005 9:51 pm Post subject: |
|
|
Sorry, my fault - the code should be placed in agenda.js instead of plugins.js.
However, this is not an elegant solution. Please let us know whether it can solve your problem. If it does, we'll be releasing an update version to introduce a switching flag for it.
_________________ Copyright 2003-2011 Idemfactor Solutions, Inc. All rights reserved. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
|
Copyright 2003- Idemfactor Solutions, Inc. All rights reserved.
Powered by phpBB © 2001, 2005 phpBB Group
|