Ver Mensaje Individual
  #4 (permalink)  
Antiguo 02/08/2007, 10:48
thunder.scripts
 
Fecha de Ingreso: febrero-2005
Mensajes: 670
Antigüedad: 19 años, 2 meses
Puntos: 0
Re: jscalendar: conectar calendarios

Modifiqué los dos scripts que vienen con el calendario: calendar.js y calendar-setup.js: http://kumquat.quickshareit.com/shar...setup8b5b5.zip

Abajo el código de los calendarios:

Código:
<script type="text/javascript">//<![CDATA[

    function closed(cal) {

		//Sync calendars
		if(cal.element.parentNode.id == 'cal1') {			
			two.setDate(new Date(one.date.getFullYear(), one.date.getMonth()+1, 1))
			three.setDate(new Date(one.date.getFullYear(), one.date.getMonth()+2, 1))
		} else if(cal.element.parentNode.id == 'cal2') {
			one.setDate(new Date(two.date.getFullYear(), two.date.getMonth()-1, 1))
			three.setDate(new Date(two.date.getFullYear(), two.date.getMonth()+1, 1))
		} else if(cal.element.parentNode.id == 'cal3') {
			one.setDate(new Date(three.date.getFullYear(), three.date.getMonth()-2, 1))
			two.setDate(new Date(three.date.getFullYear(), three.date.getMonth()-1, 1))
		} 
      
    };

    var one = Calendar.setup(
    {
		flat		: 'cal1',
		align		: 'BL',
		weekNumbers	: false,
		showOthers	: true,
		onUpdate	: closed
    });
	
	var two = Calendar.setup(
    {
		flat		: 'cal2',
		align		: 'BL',
		weekNumbers	: false,
		showOthers	: true,
		onUpdate	: closed
    });
	
	var three = Calendar.setup(
	{
		flat		: 'cal3',
		align		: 'BL',
		weekNumbers	: false,
		showOthers	: true,
		onUpdate	: closed
    });
  
//]]></script>
Esto funciona con calendarios de tipo flat, si es de los popup creo que no te va a servir.

Suerte!
Fede
__________________
Federico H. García
Desarrollo Web
www.federicog.com.ar