Revision 3711d95e
Von Thomas Heck vor etwa 11 Jahren hinzugefügt
SL/Helper/DateTime.pm | ||
---|---|---|
12 | 12 |
return shift->now(time_zone => $::locale->get_local_time_zone)->truncate(to => 'day'); |
13 | 13 |
} |
14 | 14 |
|
15 |
sub to_kivitendo_time { |
|
16 |
my ($self, %params) = _hashify(1, @_); |
|
17 |
return $::locale->format_date_object_to_time($self, %params); |
|
18 |
} |
|
19 |
|
|
15 | 20 |
sub to_kivitendo { |
16 | 21 |
my ($self, %params) = _hashify(1, @_); |
17 | 22 |
return $::locale->format_date_object($self, %params); |
SL/Locale.pm | ||
---|---|---|
380 | 380 |
return $yy && $mm && $dd ? DateTime->new(year => $yy, month => $mm, day => $dd) : undef; |
381 | 381 |
} |
382 | 382 |
|
383 |
sub format_date_object_to_time { |
|
384 |
my ($self, $datetime, %params) = @_; |
|
385 |
|
|
386 |
return $datetime->strftime('%H:%M'); |
|
387 |
} |
|
388 |
|
|
383 | 389 |
sub format_date_object { |
384 | 390 |
my ($self, $datetime, %params) = @_; |
385 | 391 |
|
Auch abrufbar als: Unified diff
DateTime::to_kivitendo_time: Formatierung eines DateTimes als Zeit