calendar-setup bug: weekend has no properties

Discussion for TimeTrex open source community developers.
Locked
jorge
Posts: 23
Joined: Thu Feb 22, 2007 2:56 am

calendar-setup bug: weekend has no properties

Post by jorge » Fri Jun 08, 2007 7:54 am

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
Our man from Havana

shaunw
Posts: 7360
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw » Fri Jun 08, 2007 8:56 am

When did this start happening, and what changes have you made recently?

jorge
Posts: 23
Joined: Thu Feb 22, 2007 2:56 am

Solved

Post by jorge » Fri Jun 08, 2007 9:13 am

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]
Our man from Havana

shaunw
Posts: 7360
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw » Fri Jun 08, 2007 9:16 am

What version of TimeTrex are you using?

Did you have a different locale set?

jorge
Posts: 23
Joined: Thu Feb 22, 2007 2:56 am

Different locale

Post by jorge » Fri Jun 08, 2007 1:07 pm

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
Our man from Havana

shaunw
Posts: 7360
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw » Fri Jun 08, 2007 1:57 pm

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.

jorge
Posts: 23
Joined: Thu Feb 22, 2007 2:56 am

Hi

Post by jorge » Sat Jun 09, 2007 12:48 am

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
Our man from Havana

shaunw
Posts: 7360
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw » Sat Jun 09, 2007 10:22 am

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.

Locked