summaryrefslogtreecommitdiff
path: root/lib/Tools.pm
diff options
context:
space:
mode:
authorAndreas Brachold <vdr07@deltab.de>2008-02-05 17:15:10 +0000
committerAndreas Brachold <vdr07@deltab.de>2008-02-05 17:15:10 +0000
commitef6b47f7c9acf0b90263bd1cfe2fa2428b1df13a (patch)
tree143fc6df90d0a6da8da3fcc9bde032aeb4dbe1fa /lib/Tools.pm
parent7846ea22a774f42f23ab9bca2854c452c55b7078 (diff)
downloadxxv-ef6b47f7c9acf0b90263bd1cfe2fa2428b1df13a.tar.gz
xxv-ef6b47f7c9acf0b90263bd1cfe2fa2428b1df13a.tar.bz2
* debian-install.sh missed by pakaging
* report: RECORDS - status message with wrong id * alist/clist/rlist: reorder sorting parameter, remove double sql query * rlist: move time formating from template to perl code
Diffstat (limited to 'lib/Tools.pm')
-rw-r--r--lib/Tools.pm17
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/Tools.pm b/lib/Tools.pm
index de0c8d4..bcf5800 100644
--- a/lib/Tools.pm
+++ b/lib/Tools.pm
@@ -49,26 +49,29 @@ use constant WEEKDAYS => qw/Sun Mon Tue Wed Thu Fri Sat/;
sub datum {
# ------------------
my $zeit = shift || time;
- my $typ = shift || 'voll';
+ my $typ = lc(shift) || 'voll';
- if(lc($typ) eq 'voll') {
+ if($typ eq 'voll') {
# full date depends locale e.g. 24.12.2007 12:00:00 or 12/24/2007 ...
return strftime("%x %X", localtime($zeit));
- } elsif(lc($typ) eq 'tag') {
+ } elsif($typ eq 'short') {
+ # short date depends locale e.g. 24.12.2007 12:00 or 12/24/2007 ...
+ return strftime("%x %H:%M", localtime($zeit));
+ } elsif($typ eq 'tag') {
# day depends locale e.g. 24.12.2007 or 12/24/2007
return strftime("%x", localtime($zeit));
- } elsif(lc($typ) eq 'weekday') {
+ } elsif($typ eq 'weekday') {
# day depends locale e.g. Fryday ,24.12.2007
return strftime("%A, %x", localtime($zeit));
- } elsif (lc($typ) eq 'int') {
+ } elsif ($typ eq 'int') {
# 1901-01-01T00:00+00:00
return strftime("%Y-%m-%dT%H:%M:%S%z", localtime($zeit));
- } elsif (lc($typ) eq 'rss') {
+ } elsif ($typ eq 'rss') {
# 23 Aug 1999 07:00:00 GMT
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime($zeit);
return sprintf('%02d %s %04d %02d:%02d:%02d GMT',
$mday, (MONTHS)[$mon], $year+1900, $hour, $min, $sec );
- } elsif (lc($typ) eq 'header') {
+ } elsif ($typ eq 'header') {
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime($zeit);
return sprintf("%s, %02d %s %04d %02d:%02d:%02d GMT",
(WEEKDAYS)[$wday],$mday,(MONTHS)[$mon],$year + 1900,$hour,$min,$sec);