[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Omaha.pm] Using Class::Date subclass instead of arrays and Date::Calc



Ooo...

BEFORE:

  use Date::Calc qw( Today Add_Delta_Days );
  $o_ra->set_arrival_date  (sprintf("%04d-%02d-%02d", Today()));
  $o_ra->set_depart_date   (sprintf("%04d-%02d-%02d", Add_Delta_Days(Today(), 1)));

AFTER:

  use Control::DateTime;                       
  my $today = Control::DateTime->new();
  $o_ra->set_arrival_date  ($today);
  $o_ra->set_depart_date   ($today + "1D");

j

(  Control::DateTime is my subclass of Class::Date qw( -DateParse )  )