Results 1 to 4 of 4

Thread: JSCalendar driving me mad

  1. #1
    petecorbs is offline Senior Member
    Join Date
    Dec 2008
    Posts
    24

    Default JSCalendar driving me mad

    Hi just downloaded and installed the latest version of Sugarcrm (5.5.0) and ran the installation as i normal would, ive been using Sugar for about 2 years but only ever on Windows (am using Ubuntu 9.10 now (see below for spec) and have a custom module i built to run my hotel bookings. After installing my module on the fresh install i have checked the JSCalendar settings and have found that no week numbers are showing and the first day is Sunday (i want Monday).

    Have checked all the calendar_setup_3.js and it seems weekNumbers,true; is set correctly but cant fathom out how to change the week number.

    Please someone help, been searching forums and the web for 24 hrs now, this was last resort posting this thread.

    Ubuntu 9.10 OS
    Firefox for Ubuntu v3.5.8
    xampp for Linux 1.7.1
    Apache/2.2.11 (Unix) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8k PHP/5.2.9 mod_apreq2-20051231/2.6.0 mod_perl/2.0.4 Perl/v5.10.0
    MySQL client version: 5.1.33
    PHP extension: mysql

  2. #2
    Superman's Avatar
    Superman is offline Sugar Community Member
    Join Date
    Oct 2005
    Location
    Kazakhstan
    Posts
    852

    Default Re: JSCalendar driving me mad

    Did you look in include/javascript/sugar_grp1.js? Find occurence of "Calendar.setup" and ensure Calendar setup params are correct.
    Farkhad Rakhimzhanov
    E-mail: farkhad@gmail.com
    Skype: rakikama

    SuperTimesheet and Invoicing — timesheet tool with invoicing for SugarCRM.
    Book time against Cases, Project Tasks and Projects.
    Create invoice regarding booked time, print it in PDF or HTML,
    customize template as you like.

  3. #3
    petecorbs is offline Senior Member
    Join Date
    Dec 2008
    Posts
    24

    Default Re: JSCalendar driving me mad

    I have checked the file you suggested and it is exactly the same code as what you find in calendar_setup_3.js

    i have pasted it below if that helps;

    */
    Calendar.setup=function(params){function param_default(pname,def){if(typeof params[pname]=="undefined"){params[pname]=def;}};param_default("inputFieldObj",null);param_ default("displayAreaObj",null);param_default("butt onObj",null);param_default("inputField",null);para m_default("displayArea",null);param_default("butto n",null);param_default("eventName","click");param_ default("ifFormat","%Y/%m/%d");param_default("daFormat","%Y/%m/%d");param_default("singleClick",true);param_defau lt("disableFunc",null);param_default("dateStatusFu nc",params["disableFunc"]);param_default("firstDay",isNaN(Calendar._FD)?0:C alendar._FD);param_default("align","Br");param_def ault("range",[1900,2999]);param_default("weekNumbers",true);param_default( "flat",null);param_default("flatCallback",null);pa ram_default("onSelect",null);param_default("onClos e",null);param_default("onOpen",null);param_defaul t("onUpdate",null);param_default("date",null);para m_default("showsTime",false);param_default("timeFo rmat","24");param_default("electric",true);param_d efault("step",2);param_default("position",null);pa ram_default("cache",false);param_default("showOthe rs",false);var tmp=["inputField","displayArea","button"];for(var i in tmp)
    {if(params[tmp[i]+'Obj']==null&&typeof params[tmp[i]]=="string")
    {params[tmp[i]]=document.getElementById(params[tmp[i]]);}
    else
    {params[tmp[i]]=params[tmp[i]+'Obj'];}}
    if(!(params.flat||params.inputField||params.displa yArea||params.button)){return false;}
    function onSelect(cal){var p=cal.params;var update=(cal.dateClicked||p.electric);if(update&&p. flat){if(typeof p.flatCallback=="function")
    p.flatCallback(cal);else
    alert("No flatCallback given -- doing nothing.");return false;}
    if(update&&p.inputField){val=cal.date.print(p.daFo rmat);val=val.substring(0,10);p.inputField.value=v al;if(typeof p.inputField.onchange=="function")
    p.inputField.onchange();}
    if(update&&p.displayArea)
    p.displayArea.innerHTML=cal.date.print(p.daFormat) ;if(update&&p.singleClick&&cal.dateClicked)
    cal.callCloseHandler();if(update&&typeof p.onUpdate=="function")
    p.onUpdate(cal);};if(params.flat!=null){if(typeof params.flat=="string")
    params.flat=document.getElementById(params.flat);i f(!params.flat){alert("Calendar.setup:\n Flat specified but can't find parent.");return false;}
    var cal=new Calendar(params.firstDay,params.date,params.onSele ct||onSelect);cal.showsTime=params.showsTime;cal.t ime24=(params.timeFormat=="24");cal.params=params; cal.weekNumbers=params.weekNumbers;cal.setRange(pa rams.range[0],params.range[1]);cal.setDateStatusHandler(params.dateStatusFunc); cal.create(params.flat);cal.show();return false;}
    var triggerEl=params.button||params.displayArea||param s.inputField;triggerEl["on"+params.eventName]=function(){if(params.onOpen){params.onOpen();}
    var dateEl=params.inputField||params.displayArea;var dateFmt=((typeof params.ifFormat!="undefined")&&params.ifFormat!="% Y/%m/%d")?params.ifFormatarams.daFormat;params.daFormat=dateFmt;if(dateFmt. indexOf(" ")>-1){dateFmt=dateFmt.substring(0,dateFmt.indexOf(" "));}
    var mustCreate=false;var cal=window.calendar;if(!(cal&&params.cache)){windo w.calendar=cal=new Calendar(params.firstDay,params.date,params.onSele ct||onSelect,params.onClose||function(cal){cal.hid e();},params.inputField);cal.showsTime=params.show sTime;cal.time24=(params.timeFormat=="24");cal.wee kNumbers=params.weekNumbers;mustCreate=true;}else{ if(params.date)
    cal.setDate(params.date);cal.hide();}
    cal.showsOtherMonths=params.showOthers;cal.yearSte p=params.step;cal.setRange(params.range[0],params.range[1]);cal.params=params;cal.setDateStatusHandler(param s.dateStatusFunc);cal.setDateFormat(dateFmt);if(mu stCreate)
    cal.create();cal.parseDate(dateEl.value||dateEl.in nerHTML);cal.refresh();if(!params.position)
    cal.showAtElement(params.button||params.displayAre a||params.inputField,params.align);else
    cal.showAt(params.position[0],params.position[1]);return false;};};

    // End of File jscalendar/calendar-setup_3.js

  4. #4
    itinaine is offline Junior Member
    Join Date
    Apr 2010
    Posts
    1

    Default Re: JSCalendar driving me mad

    Add line:

    Code:
    Calendar._FD = 1;
    to language file, eg jscalendar/lang/calendar-en.js

    This fix worked for me.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. jscalendar bug? v5.0b
    By agcopley in forum Help
    Replies: 3
    Last Post: 2008-08-27, 12:41 PM
  2. List screens show error.. driving me mad
    By ztolley in forum Developer Help
    Replies: 0
    Last Post: 2008-04-22, 12:56 PM
  3. Currency convertion rate is driving us NUTS!
    By TakeMarket in forum Help
    Replies: 4
    Last Post: 2007-04-24, 06:37 PM
  4. This Tour de France is driving me crazy!
    By andydreisch in forum Musings, Mullings, and Mutterings
    Replies: 4
    Last Post: 2006-07-27, 04:39 PM
  5. Jscalendar
    By nicolas in forum Developer Help
    Replies: 0
    Last Post: 2005-06-06, 11:20 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •