[Rt-commit] rt branch, 4.0/timezoneless-cf-date, created. rt-4.0.7-60-g8d38730

? sunnavy sunnavy at bestpractical.com
Mon Feb 11 17:01:39 EST 2013


The branch, 4.0/timezoneless-cf-date has been created
        at  8d38730cd7f399850666569108926acfe73b29bf (commit)

- Log -----------------------------------------------------------------
commit 8d38730cd7f399850666569108926acfe73b29bf
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Sep 19 23:33:20 2012 +0800

    date cf should be timezoneless
    
    we should show the same date no matter what date format is.
    
    see also #20856

diff --git a/share/html/Elements/EditCustomFieldDate b/share/html/Elements/EditCustomFieldDate
index c66640f..49734b4 100644
--- a/share/html/Elements/EditCustomFieldDate
+++ b/share/html/Elements/EditCustomFieldDate
@@ -46,11 +46,11 @@
 %#
 %# END BPS TAGGED BLOCK }}}
 % my $name = $NamePrefix.$CustomField->Id.'-Values';
-<& /Elements/SelectDate, Name => "$name", current => 0, ShowTime => 0 &> (<%$DateObj->AsString(Time => 0)%>)
+<& /Elements/SelectDate, Name => "$name", current => 0, ShowTime => 0 &> (<%$DateObj->AsString(Time => 0, Timezone => 'utc')%>)
 
 <%INIT>
 my $DateObj = RT::Date->new ( $session{'CurrentUser'} );
-$DateObj->Set( Format => 'unknown', Value => $Default );
+$DateObj->Set( Format => 'unknown', Value => $Default, Timezone => 'utc' );
 </%INIT>
 <%ARGS>
 $Object => undef
diff --git a/share/html/Elements/ShowCustomFieldDate b/share/html/Elements/ShowCustomFieldDate
index 8c94c13..2bce717 100644
--- a/share/html/Elements/ShowCustomFieldDate
+++ b/share/html/Elements/ShowCustomFieldDate
@@ -48,8 +48,8 @@
 <%INIT>
  my $content = $Object->Content;
  my $DateObj = RT::Date->new ( $session{'CurrentUser'} );
- $DateObj->Set( Format => 'unknown', Value => $content );
- $content = $DateObj->AsString(Time => 0);
+ $DateObj->Set( Format => 'unknown', Value => $content, Timezone => 'utc'  );
+ $content = $DateObj->AsString(Time => 0, Timezone => 'utc');
 </%INIT>
 <%$content|n%>
 <%ARGS>

-----------------------------------------------------------------------


More information about the Rt-commit mailing list