Foros del Web » Programando para Internet » Javascript » Frameworks JS »

Como Asignar Fecha a jsDatePick

Estas en el tema de Como Asignar Fecha a jsDatePick en el foro de Frameworks JS en Foros del Web. Hola estoy haciendo un sistema de turnos y para seleccionar el día uso el calendario jsDatePick, pero no logro asignarle una fecha, ya que siempre ...
  #1 (permalink)  
Antiguo 13/05/2014, 20:44
 
Fecha de Ingreso: abril-2007
Ubicación: Merlo
Mensajes: 314
Antigüedad: 17 años
Puntos: 3
Como Asignar Fecha a jsDatePick

Hola estoy haciendo un sistema de turnos y para seleccionar el día uso el calendario jsDatePick, pero no logro asignarle una fecha, ya que siempre queda mostrando la fecha del servidor.

Por ejemplo, si hoy es 14 de Mayo de 2014 (14/05/2014) y selecciono el día 4 de junio de 2014 (04/06/2014) le agregue una linea al scrip para que recargue la pagina (ya que asigna turnos por hora) pero por masque los turnos me los guarda como 04/06/2014 me vuelve a mostrar el día 14/05/2014.

el script es este.
Código HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jsDatePick Javascript example</title>
<!-- 

	Copyright 2009 Itamar Arjuan
	jsDatePick is distributed under the terms of the GNU General Public License.
	
	****************************************************************************************

	Copy paste these 2 lines of code to every page you want the calendar to be available at
-->
<link rel="stylesheet" type="text/css" media="all" href="jsDatePick_ltr.min.css" />
<!-- 
	OR if you want to use the calendar in a right-to-left website
	just use the other CSS file instead and don't forget to switch g_jsDatePickDirectionality variable to "rtl"!
	
	<link rel="stylesheet" type="text/css" media="all" href="jsDatePick_ltr.css" />
-->
<script type="text/javascript" src="jsDatePick.min.1.3.js"></script>
<!-- 
	After you copied those 2 lines of code , make sure you take also the files into the same folder :-)
    Next step will be to set the appropriate statement to "start-up" the calendar on the needed HTML element.
    
    The first example of Javascript snippet is for the most basic use , as a popup calendar
    for a text field input.
-->
<script type="text/javascript">
	window.onload = function(){
		new JsDatePick({
			useMode:1,
			target:"inputField",
			dateFormat:"%d-%M-%Y",
			selectedDate:{				
				day:5,
				month:9,
				year:2006
			},
			yearsRange:[1978,2020],
			limitToToday:false,
			cellColorScheme:"blue",
			dateFormat:"%m-%d-%Y",
			imgPath:"img/",/**/
			weekStartDay:0
		});
	};
</script>
</head>
<body>
    <div id="inputField">
</body>
</html> 
por que no funciona el "selecteDate"?
Ese no deberia dejarme asignarle una fecha???
  #2 (permalink)  
Antiguo 13/05/2014, 22:06
Avatar de Triby
Mod on free time
 
Fecha de Ingreso: agosto-2008
Ubicación: $MX->Gto['León'];
Mensajes: 10.106
Antigüedad: 15 años, 8 meses
Puntos: 2237
Respuesta: forzar fecha a jaDatePick

Parece que hay algún error con la librería, porque tampoco funciona en el ejemplo: http://javascriptcalendar.org/javasc...ate-picker.php

Por cierto, tienes dos dateFormat con diferente formato.
__________________
- León, Guanajuato
- GV-Foto
  #3 (permalink)  
Antiguo 14/05/2014, 06:20
 
Fecha de Ingreso: abril-2007
Ubicación: Merlo
Mensajes: 314
Antigüedad: 17 años
Puntos: 3
Respuesta: Como Asignar Fecha a jsDatePick

Si lo hago en un input tipo texto y uso useMode:2 funciona bien.
  #4 (permalink)  
Antiguo 14/05/2014, 17:10
Avatar de Triby
Mod on free time
 
Fecha de Ingreso: agosto-2008
Ubicación: $MX->Gto['León'];
Mensajes: 10.106
Antigüedad: 15 años, 8 meses
Puntos: 2237
Respuesta: Como Asignar Fecha a jsDatePick

Por cierto, ahora que lo mencionas, ya te diste cuenta que no cerraste el div?
__________________
- León, Guanajuato
- GV-Foto
  #5 (permalink)  
Antiguo 16/05/2014, 10:08
 
Fecha de Ingreso: abril-2007
Ubicación: Merlo
Mensajes: 314
Antigüedad: 17 años
Puntos: 3
Respuesta: Como Asignar Fecha a jsDatePick

Después me di cuente!!!
Igual no se podía hacer!!!
Gracias por tu ayuda

Etiquetas: fecha, funcion, html, input, javascript, js, select, variable
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 10:39.