From 7097fc88603c246f4a36467baefd5c6910ca1e60 Mon Sep 17 00:00:00 2001 From: Darold Gilles Date: Mon, 26 Nov 2012 19:16:49 +0100 Subject: [PATCH] Add the use %M to replace month by its 3 letters abbreviation into DateFormat configuration directive. Thanks to pk-its for the feature request. --- SquidAnalyzer.pm | 7 ++++--- squidanalyzer.conf | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/SquidAnalyzer.pm b/SquidAnalyzer.pm index dc49830..f9f10d8 100644 --- a/SquidAnalyzer.pm +++ b/SquidAnalyzer.pm @@ -3000,10 +3000,11 @@ sub set_date $date_format =~ s/\%y/$year/i; $date_format =~ s/\%m/$month/i; $date_format =~ s/\%d/$day/i; + $date_format =~ s/\%M/$Translate{$month}/i; - $date_format =~ s/\D{2,3}//; - $date_format =~ s/^\D+//; - $date_format =~ s/\D+$//; + $date_format =~ s/([^\p{Letter}\p{Digit}]){2,3}/$1/; + $date_format =~ s/^[^\p{Letter}\p{Digit}]+//; + $date_format =~ s/[^\p{Letter}\p{Digit}]+$//; return $date_format; } diff --git a/squidanalyzer.conf b/squidanalyzer.conf index d854fff..884bf5f 100644 --- a/squidanalyzer.conf +++ b/squidanalyzer.conf @@ -63,6 +63,7 @@ Exclude /etc/squidanalyzer/excluded #Lang /etc/squidanalyzer/lang/fr_FR.txt # Date format use to display date (year = %y, month = %m and day = %d) +# You can also use %M to replace month by its 3 letters abbreviation. DateFormat %y-%m-%d # Custom Footer. Must be a path to a text file containing HTML code that