Board Logo

Problem with October...
libe - 9/16/2009 at 02:37 PM

Hi,
I have a problem with october


aemege - 10/1/2009 at 06:22 PM

Search for the line 230

where said:
d_current.setDate(++n_date);
while (d_current.getDate() != n_date && d_current.getMonth() == n_month) {
d_current.setHours(d_current.getHours + 1);
d_current = f_tcalResetTime(d_current);
}
Change to:
d_current.setDate(d_current.getDate()+1);
++n_date;


aemege - 10/1/2009 at 06:52 PM

Updated, try this

d_current.setDate(++n_date);
while (d_current.getDate() != n_date && d_current.getMonth() == n_month) {
d_current.setDate(d_current.getDate()+1);
}


jacktsai - 12/3/2010 at 05:52 PM

Hi! The patch u posted solved October issue (as i was having it too), but still doesnt mark on calendar the date shown on textfield, as it does on the dates outside this October bugged days range.

Please give us a hint about it, and thanks for the solution already provided.


thansen - 12/8/2010 at 01:10 PM

Hello,

I just corrected the file calendar.js, what you need to do is:

1) Apply the "aemege" patch (posted on 10/1/2009 at 06:52 PM):

near line 232 (depending on calendar version and flavour - eu or us), where you read:
d_current.setDate(++n_date);
while (d_current.getDate() != n_date && d_current.getMonth() == n_month) {
d_current.setHours(d_current.getHours + 1);
d_current = f_tcalResetTime(d_current);
}

change to:
d_current.setDate(++n_date);
while (d_current.getDate() != n_date && d_current.getMonth() == n_month) {
d_current.setDate(d_current.getDate()+1);
}

2) My patch:
near line 226, where you read:
// selected
if (d_current.valueOf() == d_selected.valueOf())
a_class[a_class.length] = 'selected';
change to:
if (d_current.getDate() == d_selected.getDate() && d_current.getMonth() == d_selected.getMonth() && d_current.getFullYear() == d_selected.getFullYear())
a_class[a_class.length] = 'selected';

That's all! odd, isn't it? for some strange reason, method valueOf returns a mess on october 3rd week. However, if you test the day, month and year separely, everything works fine!

Hope this help, guys!
I'm attaching my version of calendar.js. In fact, it's the calendar_eu.js renamed, since I use dd/mm/yyyy date mask.

Cheers!


Softcomplex: http://www.softcomplex.com/
Back to forum: http://www.softcomplex.com/forum/