From b4bc36d23d693503981501e575627c4b68c662e5 Mon Sep 17 00:00:00 2001 From: Nik Ogura Date: Sun, 1 Apr 2007 00:38:48 +0000 Subject: [PATCH] added custom handling to the %D format to remove initial space in single space days. --- lib/WebGUI/Session/DateTime.pm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/WebGUI/Session/DateTime.pm b/lib/WebGUI/Session/DateTime.pm index a1f1aa288..9f6bd76a6 100644 --- a/lib/WebGUI/Session/DateTime.pm +++ b/lib/WebGUI/Session/DateTime.pm @@ -323,7 +323,7 @@ sub epochToHuman { "c" => "B", "C" => "b", "d" => "d", - "D" => "e", + "D" => "_varday_", "h" => "I", "H" => "l", "j" => "H", @@ -346,10 +346,15 @@ sub epochToHuman { my $replacement = $conversion{$key}; $output =~ s/\~$key/\%$replacement/g; } - #--- %M + $output = $dt->strftime($output); + + #--- %M $temp = int($dt->month); $output =~ s/\%_varmonth_/$temp/g; + #-- %D + $temp = int($dt->day); + $output =~ s/\%_varday_/$temp/g; #--- return return $output; }