Foros del Web » Programando para Internet » Javascript »

Calendarios javascript

Estas en el tema de Calendarios javascript en el foro de Javascript en Foros del Web. Saludos quisiera saber si hay calendarios javascript que funcionen con un formato de fecha de lunes a sábado... o una web donde pudiera descargarlo. Gracias ...
  #1 (permalink)  
Antiguo 17/02/2008, 15:49
 
Fecha de Ingreso: febrero-2008
Mensajes: 65
Antigüedad: 16 años, 2 meses
Puntos: 0
Calendarios javascript

Saludos

quisiera saber si hay calendarios javascript que funcionen con un formato de fecha de lunes a sábado...

o una web donde pudiera descargarlo.

Gracias de antemano.

Walleska
  #2 (permalink)  
Antiguo 17/02/2008, 18:55
 
Fecha de Ingreso: diciembre-2007
Ubicación: Argentina
Mensajes: 151
Antigüedad: 16 años, 4 meses
Puntos: 2
Re: Calendarios javascript

Te dejo una página con un ejemplo javascript para insertar un calendario bastante completo y atractivo. Igualmente puedes buscar en Google y te salen dos millones de páginas sobre este tema.

Aca va la URL :

http://www.codigojavascript.com/hora-fecha/calendarios-javascript.php

Saludos
  #3 (permalink)  
Antiguo 17/02/2008, 20:20
 
Fecha de Ingreso: febrero-2008
Mensajes: 65
Antigüedad: 16 años, 2 meses
Puntos: 0
Re: Calendarios javascript

Gracias por tu tiempo en atender y responder.

Disculpa mi error pero no me expliqué bien, lo que quiero lograr es validar la fecha, es decir, que si alguien seleccionara del calendario javascript un día Domingo, se muestre un alerta diciendo que El Día Domingo no se puede seleccionar...

Espero me haya explicado bien...

Gracias.

Walleska
  #4 (permalink)  
Antiguo 17/02/2008, 23:59
Avatar de caricatos
Moderador
 
Fecha de Ingreso: abril-2002
Ubicación: Torremolinos (Málaga)
Mensajes: 19.607
Antigüedad: 22 años
Puntos: 1284
Re: Calendarios javascript

Hola:

Otro calendario: Fechas

Luego solo tendrías que redefinir la salida:

Código:
function seleccionaFecha(dd, mm, aa)	{
	var fecha = new Date();
	fecha.setDate(dd);
	fecha.setMonth(mm - 1);
	fecha.setFullYear(aa);
	var hoy = fecha.getDay();
	var Semana = ["Dominago","Lunes","Martes","Miércoles","Jueves","Viernes","Sabado"];
	var mes = ",enero,febrero,marzo,abril,mayo,junio,julio,agosto,septiembre,octubre,noviembre,diciembre".split(",");
	cadena = Semana[hoy] + " " + dd + " de " + mes[mm] + " de " + aa;
	if (hoy == 0)
		alert("Los Domingos no trabajamos...");
	else
		document.forms.salida.comentario.value = cadena;
}
Saludos
__________________
Por favor:
No hagan preguntas de temas de foros en mensajes privados... no las respondo
  #5 (permalink)  
Antiguo 18/02/2008, 07:52
Avatar de messer  
Fecha de Ingreso: julio-2004
Mensajes: 467
Antigüedad: 19 años, 9 meses
Puntos: 5
Re: Calendarios javascript

Que tal deshabilitando el domingo y punto, me refiero a que aparezca bloqueado y no se pueda hacer click..

Saludos!
__________________
<script type="text/messerScript"><!--
window.onload=function(){ loadMesserRules(this.href) }
--></script>
  #6 (permalink)  
Antiguo 18/02/2008, 07:53
 
Fecha de Ingreso: febrero-2008
Mensajes: 65
Antigüedad: 16 años, 2 meses
Puntos: 0
Re: Calendarios javascript

Disculpen tanto fastidio.. pero soy nueva en javascript y de verdad no se donde modificar eso..
pongo el código a ver si me pueden ayudar:

tengo tres archivos que hacen que funcione el calendario. y no se donde restringir que se seleccione el día domingo: creo que en esa parte del código esta para modificarlo....:

calendar.js
Código:
/**
 *  (RE)Initializes the calendar to the given date and firstDayOfWeek
 */
Calendar.prototype._init = function (firstDayOfWeek, date) {
	var today = new Date(),
		TY = today.getFullYear(),
		TM = today.getMonth(),
		TD = today.getDate();
	this.table.style.visibility = "hidden";
	var year = date.getFullYear();
	if (year < this.minYear) {
		year = this.minYear;
		date.setFullYear(year);
	} else if (year > this.maxYear) {
		year = this.maxYear;
		date.setFullYear(year);
	}
	this.firstDayOfWeek = firstDayOfWeek;
	this.date = new Date(date);
	var month = date.getMonth();
	var mday = date.getDate();
	var no_days = date.getMonthDays();

	// calendar voodoo for computing the first day that would actually be
	// displayed in the calendar, even if it's from the previous month.
	// WARNING: this is magic. ;-)
	date.setDate(1);
	var day1 = (date.getDay() - this.firstDayOfWeek) % 7;
	if (day1 < 0)
		day1 += 7;
	date.setDate(-day1);
	date.setDate(date.getDate() + 1);

	var row = this.tbody.firstChild;
	var MN = Calendar._SMN[month];
	var ar_days = this.ar_days = new Array();
	var weekend = Calendar._TT["WEEKEND"];
	var dates = this.multiple ? (this.datesCells = {}) : null;
	for (var i = 0; i < 6; ++i, row = row.nextSibling) {
		var cell = row.firstChild;
		if (this.weekNumbers) {
			cell.className = "day wn";
			cell.innerHTML = date.getWeekNumber();
			cell = cell.nextSibling;
		}
		row.className = "daysrow";
		var hasdays = false, iday, dpos = ar_days[i] = [];
		for (var j = 0; j < 7; ++j, cell = cell.nextSibling, date.setDate(iday + 1)) {
			iday = date.getDate();
			var wday = date.getDay();
			cell.className = "day";
			cell.pos = i << 4 | j;
			dpos[j] = cell;
			var current_month = (date.getMonth() == month);
			if (!current_month) {
				if (this.showsOtherMonths) {
					cell.className += " othermonth";
					cell.otherMonth = true;
				} else {
					cell.className = "emptycell";
					cell.innerHTML = "&nbsp;";
					cell.disabled = true;
					continue;
				}
			} else {
				cell.otherMonth = false;
				hasdays = true;
			}
			cell.disabled = false;
			cell.innerHTML = this.getDateText ? this.getDateText(date, iday) : iday;
			if (dates)
				dates[date.print("%Y%m%d")] = cell;
			if (this.getDateStatus) {
				var status = this.getDateStatus(date, year, month, iday);
				if (this.getDateToolTip) {
					var toolTip = this.getDateToolTip(date, year, month, iday);
					if (toolTip)
						cell.title = toolTip;
				}
				if (status === true) {
					cell.className += " disabled";
					cell.disabled = true;
				} else {
					if (/disabled/i.test(status))
						cell.disabled = true;
					cell.className += " " + status;
				}
			}
			if (!cell.disabled) {
				cell.caldate = new Date(date);
				cell.ttip = "_";
				if (!this.multiple && current_month
				    && iday == mday && this.hiliteToday) {
					cell.className += " selected";
					this.currentDateEl = cell;
				}
				if (date.getFullYear() == TY &&
				    date.getMonth() == TM &&
				    iday == TD) {
					cell.className += " today";
					cell.ttip += Calendar._TT["PART_TODAY"];
				}
				if (weekend.indexOf(wday.toString()) != -1)
					cell.className += cell.otherMonth ? " oweekend" : " weekend";
			}
		}
		if (!(hasdays || this.showsOtherMonths))
			row.className = "emptyrow";
	}
	this.title.innerHTML = Calendar._MN[month] + ", " + year;
	this.onSetTime();
	this.table.style.visibility = "visible";
	this._initMultipleDates();
	// PROFILE
	// this.tooltips.innerHTML = "Generated in " + ((new Date()) - today) + " ms";
};
disculpen por el codigo..
  #7 (permalink)  
Antiguo 22/02/2008, 13:43
Avatar de tatyta  
Fecha de Ingreso: febrero-2008
Ubicación: Caracas Venezuela
Mensajes: 14
Antigüedad: 16 años, 2 meses
Puntos: 0
Re: Calendarios javascript

hola walleska, estoy en lo mismo, si sabes de alguno me avisas, bueno en realidad lo que yo quiero es un calendario que se abra cuando le damos click a una ventanita, para llenar de forma mas rapida un formulario
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 20:29.