Forums

Date Picker and sh404sef

DarkBlaze 08 Feb, 2009
Ok, so i have sh404sef installed on joomla, and when it's enabled, the date picker doesn't display previos/next month and close button....
when i disable sh404sef, everything works.... any ideas ?
GreyHead 08 Feb, 2009
Hi darkblaze,

Absolutely no idea - as far as I recall the datepicker is pure javascript and doesn't use urls and sf404seh has no javascript and only runs on submit . . .

Is the page online?

Bob
DarkBlaze 08 Feb, 2009
The page is not yet on-line, but i've enabled it....
Here's the catch...
If i run the form from the chronoforms form list, it is launcehd in a new tab (right click --> open in new tab), and sh404sef automaticly generates the link...
the link is http://www.investigo.hr/upit/2009_skijanje_rogla/ --> "upit" is Croatian for "Form" and the 2009_skijanje_rogla is the form name.....
now here's what I've figured out so far....
this default link actually has an "old link" or the original link "index.php?option=com_chronocontact&chronoformname=2009_skijanje_rogla&lang=hr" that DOES NOT WORK

now there is definitely a problem with the language.... the above one has a "&lang=hr" at the end of the url...

So I tried to make a custom url with a "&lang=en" at the end of url AND THIS ONE WORKS !

I've tried to add some of the code to the calendar.js hoping it looks for a language there, and translated it to Croatian, and still it doesn't work when having "&lang=hr" at the and nor does it use the translation that i made....

Please, if anyone could help me with this one, cause I am obviously missing something.....

Here is a link generated by sh404sef (the one that doesn't wok):
SEF link --> http://www.investigo.hr/upit/2009_skijanje_rogla/
Original link --> index.php?option=com_chronocontact&chronoformname=2009_skijanje_rogla&lang=hr

Custom link that woks
SEF link --> http://www.investigo.hr/custom_skijanjee
Original link --> index.php?option=com_chronocontact&chronoformname=2009_skijanje_rogla&lang=en

Here is a peace of the code that I've added and a line that is changed

var Calendar = new Class({
    initialize: function(el,open,Config) {
   this.input = $(el);
			var lng = new Object();

			// Firefox? IE ?
			try {  var nav = navigator.language.substr(0,2); }
			catch (e)	{ var nav = navigator.userLanguage;}

			lng['en'] = {
      	month : ['January','February','March','April','May','June','July','August','September','October','November','December'],
      	day : ['S','M','T','W','T','F','S'],
      	first: 1 // First day of week => Monday
			}
      lng['es'] = {
      	month : ['Enero','Febrero','Marzo','Abril','Mayo','Junio','Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'],
      	day : ['L','M','M','J','V','S','D'],
      	first: 1 // First day of week => Monday
			};
			lng['pl'] = {
      	month : ['Styczen', 'Luty', 'Marzec', 'Kwiecien', 'Maj', 'Czerwiec', 'Lipiec', 'Sierpien', 'Wrzesien', 'Pazdziernik', 'Listopad', 'Grudzien'],
				day : ['P','W','S','C','P','S','N'],
				first: 1 // Sunday
      }
      lng['nl'] = {
      	month : ['Januari', 'Februari', 'Maart', 'April', 'Mei', 'Juni', 'Juli', 'Augustus', 'September', 'Oktober', 'November', 'December'],
      	day : ['M','D','W','D','V','Z','Z'],
      	first: 1 // Monday
      }
// this is the Croatian translation that I've added to the file
			lng['hr'] = {
      	month : ['Siječanj','Veljača','Ožujak','Travanj','Svibanj','Lipanj','Srpanj','Kolovoz','Rujan','Listopad','Studeni','Prosinac'],
      	day : ['N','P','U','S','Č','P','S'],
      	first: 1 // First day of week => Monday
			}
                
			lng = (!lng[nav])? lng['hr'] : lng =  lng[nav] ; // I have changed the second lng thing to hr assuming it to be the default language
      /* configuration */
      if (!Config)
	      this.config = {
						Lng: lng,
					  imgNext: 'components/com_chronocontact/css/img/next.gif',
					  imgPrev: 'components/com_chronocontact/css/img/prev.gif',
					  imgCancel: 'components/com_chronocontact/css/img/close.gif',
					  maxDate: new Date('01/01/2020'), // I've also changed the date ranges here and in the next line
					  minDate: new Date('01/01/2009'),
					  format: 'd/m/y'
				};
DarkBlaze 08 Feb, 2009
Ok so I've looked at the code some more, and found and interesting peace of code.....

Am I loosing my mind or does it read the browsers language ? If so, that a bad idea, at least in my case....

So... is there a way that the js reads joomla's language and by that decides what language to use ?

So if the site is in croatian it would "hr", in english "en" and so on..... ?
Max_admin 08 Feb, 2009
Hi DarkBlaze,

I didn't read the whole post but the calendar has some issues with SEF links yes, I'm not sure if it happens with Joomla's core SEF or no though, anyway I will replace the whole calendar script in the new release which will be out soon, I made good progress this weekend!

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.