Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 646cb2aa

Von Moritz Bunkus vor mehr als 10 Jahren hinzugefügt

  • ID 646cb2aa3a79d7b35a1673fc67cdf802e9cba515
  • Vorgänger d16e003e
  • Nachfolger 4c53e121

Locale::parse_date_to_object: Unterstützung für volle Timestamps & explizite Formate

…und dafür Tests.

Unterschiede anzeigen:

SL/RP.pm
58 58
  my $asofdate = shift;
59 59
  return unless $asofdate;
60 60

  
61
  $asofdate = $::locale->parse_date_to_object(\%::myconfig, $asofdate);
61
  $asofdate = $::locale->parse_date_to_object($asofdate);
62 62

  
63 63
  my $form = $main::form;
64 64
  my $dbh  = $::form->get_standard_dbh;
......
85 85
  # default.
86 86
  my ($closedto) = selectfirst_array_query($form, $dbh, 'SELECT closedto FROM defaults');
87 87
  if ($closedto) {
88
    $closedto = $::locale->parse_date_to_object(\%::myconfig, $closedto);
88
    $closedto = $::locale->parse_date_to_object($closedto);
89 89
    $closedto->subtract(years => 1) while ($asofdate - $closedto)->is_negative;
90 90
    $closedto->add(days => 1);
91 91
  };
......
93 93
  my ($query, $startdate, $last_ob, $mindate);
94 94
  $query = qq|select max(transdate) from acc_trans where ob_transaction is true and transdate <= ?|;
95 95
  ($last_ob) = selectrow_query($::form, $dbh, $query, $::locale->format_date(\%::myconfig, $asofdate));
96
  $last_ob = $::locale->parse_date_to_object(\%::myconfig, $last_ob) if $last_ob;
96
  $last_ob = $::locale->parse_date_to_object($last_ob) if $last_ob;
97 97

  
98 98
  $query = qq|select min(transdate) from acc_trans|;
99 99
  ($mindate) = selectrow_query($::form, $dbh, $query);
100
  $mindate = $::locale->parse_date_to_object(\%::myconfig, $mindate);
100
  $mindate = $::locale->parse_date_to_object($mindate);
101 101

  
102 102
  # the default method is to use all transactions ($mindate)
103 103

  

Auch abrufbar als: Unified diff