Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Grupo de Teaming del ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 11-01-2004
bustio bustio is offline
Miembro
 
Registrado: oct 2003
Posts: 231
Poder: 21
bustio Va por buen camino
Arrow Algoritmo de FECHA

Hola y saludos desde La Habana...
Necesito un algoritmo que me permita restringir el uso de un TDateTimePicker a la semana en curso..para hacer reservaciones en sus dias, pero solo de la semana en curso.
Ya se que con el MinDate puedo ponerle la fecha actual para restringirlo al dia actual(TDateTimePicker.MinDate := Now - 1) pero como hacer esto para que TDateTimePicker.MaxDate := Domingo de esa semana????.
Las reservaciones que necesito hacer sus fechas deben ir desde el dia actual hasta el domingo de esa semana, y que lo incluya, por supuesto. Al llegar el lunes de la semana siguiente necesito que ese proceso se repita.
De veras estoy perdido con el TDateTimePicker, y a pesar de que ya he intentado hacerlo varias veces no me trabaja...
Ademas, deseo FELICITAR a todos los que tengan que ver con esta Web.... de veras que estan fuera de LIGA.. dicho en buen Cubano..
GRACIAS
Responder Con Cita
  #2  
Antiguo 11-01-2004
Avatar de Lepe
[Lepe] Lepe is offline
Miembro Premium
 
Registrado: may 2003
Posts: 7.424
Poder: 29
Lepe Va por buen camino
DayOfTheWeek(date:tdatetime)

Returns the day of the week represented by a TDateTime value.

Unit

DateUtils

Category

date/time routines

function DayOfTheWeek(const AValue: TDateTime): Word;

Description

Call DayOfTheWeek to obtain the day of the week represented by a specified TDateTime value. DayOfTheWeek returns a value between 1 and 7, where 1 indicates Monday and 7 indicates Sunday.

Note: DayOfTheWeek is ISO 8601 compliant (where Monday is considered the first day of the week). To obtain the day of the week where Sunday is considered the first day of the week, use the DayOfWeek function instead.
Tip: To make the return value more readable, use the Day of week constants.

Si dayoftheweek(now) te dice que es el 3 (Miercoles)
Código:
  datepicker1.maxdate:= now+ (7-dayoftheweek(now))
saludos

Última edición por Lepe fecha: 11-01-2004 a las 20:48:52.
Responder Con Cita
Respuesta



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 06:02:33.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi