Ver Mensaje Individual
  #1  
Antiguo 17-02-2012
Avatar de roman
roman roman is offline
Moderador
 
Registrado: may 2003
Ubicación: Ciudad de México
Posts: 20.269
Reputación: 10
roman Es un diamante en brutoroman Es un diamante en brutoroman Es un diamante en bruto
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
Responder Con Cita