Ver Mensaje Individual
  #20  
Antiguo 17-02-2012
Avatar de Delphius
[Delphius] Delphius is offline
Miembro Premium
 
Registrado: jul 2004
Ubicación: Salta, Argentina
Posts: 5.582
Reputación: 25
Delphius Va camino a la fama
Cita:
Empezado por roman Ver Mensaje
Y bueno, si les parecen muchas líneas, también podemos hacer así la función:

Código Delphi [-]
function LaboralAnterior(ADate: TDate): TDate;
begin
    Result := IncDay(ADate, -1-2*Integer(DayOfTheWeek(ADate) = 1)-Integer(DayOfTheWeek(ADate) = 7));
end;



// Saludos
¿-1-2?

Lo tuyo ya es de presumido Te voy a acusar con el profe porque nos estás haciendo quedar mal

Yo me quedo con el case, definir el decremento y calcular.

Saludos,
__________________
Delphius
[Guia de estilo][Buscar]
Responder Con Cita