Page 1 of 1

calendar-setup bug: weekend has no properties

Posted: Fri Jun 08, 2007 7:54 am
by jorge
Hi fellows:
My calendar selection is not working in any browser. The Firefox debugger throws the following error:
weekend has no properties
Calendar()calendar_stripped... (line 14)
Calendar(undefined)calendar_stripped... (line 14)
setup()calendar-setup_st... (line 21)
[Break on this error] Calendar=function(firstDayOfWeek,dateStr,onSelected,onClose){this.activeDiv=nul...

I didn't find any reference to the weekend param.
I tried loading the calendar-setup.js but the bug persists and still points to the calendar-setup-stripped.js file

Thnks
Best Regards

Posted: Fri Jun 08, 2007 8:56 am
by shaunw
When did this start happening, and what changes have you made recently?

Solved

Posted: Fri Jun 08, 2007 9:13 am
by jorge
Hi:
To solve this issue just add the follwing definitions to the calendar's lang file:

// date formats
Calendar._TT["WEEKEND"] = "0,6"; //DEpending on your locale e.g: 1,6 mean Monday is the firstday of the week, I guess.

Thanks a lot anyway!
[/i]

Posted: Fri Jun 08, 2007 9:16 am
by shaunw
What version of TimeTrex are you using?

Did you have a different locale set?

Different locale

Posted: Fri Jun 08, 2007 1:07 pm
by jorge
Hi:
I'm using the 2 release with localisation support. I use a different locale, swedish.
Still the date format is not working right. Instead of dd.mm.yy it returns dd-mm-yy in the date_stamp field after selecting the data from the pop-up calendar., wich in turn causes subsequents time's calculations to fail.
I haven't found a solution fot that


Best regards

Posted: Fri Jun 08, 2007 1:57 pm
by shaunw
Can you please provide the exact language, country and date format you are using in TimeTrex, so we can re-produce the issue on our end.

Hi

Posted: Sat Jun 09, 2007 12:48 am
by jorge
The bug can be replicated if you add a noregian locale. When you try to use the data picker it will not work until your add these missign defintions to the calendar-no.js
Calendar._TT["WEEKEND"] = "1,6";
Calendar._TT["TIME"] = "Endre:";
Calendar._TT["DAY_FIRST"] = "Vis først";

Date formats are as follow
// date formats
Calendar._TT["DEF_DATE_FORMAT"] = "%d.%m.%Y";
Calendar._TT["TT_DATE_FORMAT"] = "%d.%m.%Y";

Afterwars date picker works properly, except for the date-pikcer's field:the date in the date_stamp field comes out formated like dd-mm-yy instead of dd.mm.yy.

I haven't done any further investigation afterwards

Best Regards

Posted: Sat Jun 09, 2007 10:22 am
by shaunw
I see, so you've added your own custom locale that doesn't come with TimeTrex.

The date format it controlled by the user preferences, and passed to the date picker (calendar) in interfaces/global.js.php right near the top. These formats must match so the date parser knows which format to parse as well.