[Bps-public-commit] rt-extension-localdateheader branch, master, updated. ac97205dd6a0a4f93afdda61bb4430bf96ae5698
? sunnavy
sunnavy at bestpractical.com
Mon Aug 27 21:58:23 EDT 2012
The branch, master has been updated
via ac97205dd6a0a4f93afdda61bb4430bf96ae5698 (commit)
via c2cec9eb969b65cef9a669b0001538514bfe0c4c (commit)
from f5df9ac7d0778a77a2d64634de55cab75d5b56be (commit)
Summary of changes:
.../Ticket/Elements/ShowMessageHeaders/BeforeLocalization | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
- Log -----------------------------------------------------------------
commit c2cec9eb969b65cef9a669b0001538514bfe0c4c
Author: sunnavy <sunnavy at bestpractical.com>
Date: Tue Aug 28 09:51:47 2012 +0800
remove heading and trailing values from date value
diff --git a/html/Callbacks/LocalDateHeader/Ticket/Elements/ShowMessageHeaders/BeforeLocalization b/html/Callbacks/LocalDateHeader/Ticket/Elements/ShowMessageHeaders/BeforeLocalization
index 29c3786..bbf6283 100644
--- a/html/Callbacks/LocalDateHeader/Ticket/Elements/ShowMessageHeaders/BeforeLocalization
+++ b/html/Callbacks/LocalDateHeader/Ticket/Elements/ShowMessageHeaders/BeforeLocalization
@@ -1,6 +1,8 @@
<%init>
for my $header ( @$headers ) {
if ( $header->{Tag} eq 'Date' && $header->{Value} ) {
+ $header->{Value} =~ s!^\s+!!;
+ $header->{Value} =~ s!\s+$!!;
my $date = RT::Date->new($session{CurrentUser});
$date->Set(
Format => 'unknown',
commit ac97205dd6a0a4f93afdda61bb4430bf96ae5698
Author: sunnavy <sunnavy at bestpractical.com>
Date: Tue Aug 28 09:58:08 2012 +0800
just show the date if it's already the user's timezone
diff --git a/html/Callbacks/LocalDateHeader/Ticket/Elements/ShowMessageHeaders/BeforeLocalization b/html/Callbacks/LocalDateHeader/Ticket/Elements/ShowMessageHeaders/BeforeLocalization
index bbf6283..eacb5fc 100644
--- a/html/Callbacks/LocalDateHeader/Ticket/Elements/ShowMessageHeaders/BeforeLocalization
+++ b/html/Callbacks/LocalDateHeader/Ticket/Elements/ShowMessageHeaders/BeforeLocalization
@@ -10,7 +10,7 @@ for my $header ( @$headers ) {
Timezone => 'UTC',
);
- if ( $date->Unix ) {
+ if ( $date->Unix && $header->{Value} ne $date->RFC2822(Timezone => 'user') ) {
$header->{Value} = $date->RFC2822(Timezone => 'user') . qq! <span style="color:grey">($header->{Value})</span>!;
}
}
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list