[Rt-commit] rt branch, 4.4-trunk, updated. rt-4.4.0rc2-13-g169665a

Shawn Moore shawn at bestpractical.com
Fri Dec 4 11:30:03 EST 2015


The branch, 4.4-trunk has been updated
       via  169665a10b018f6bc60e52b9b1de472bb1b65c82 (commit)
       via  1f9624e5d92e6b727b86dd6f208bfae66051fc8e (commit)
       via  99d8560299c4a985d664f1ce7b7ed8bf248e4fea (commit)
      from  181d1659bc8e4103942ee787127922486f66b4c1 (commit)

Summary of changes:
 lib/RT/Date.pm | 72 +++++++++++++++++++++++++++++++++++++++++++---------------
 1 file changed, 54 insertions(+), 18 deletions(-)

- Log -----------------------------------------------------------------
commit 1f9624e5d92e6b727b86dd6f208bfae66051fc8e
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Tue Nov 24 20:28:28 2015 +0000

    Add an RT::Date->Strftime method
    
        Fixes: I#31435

diff --git a/lib/RT/Date.pm b/lib/RT/Date.pm
index e5914b7..d089419 100644
--- a/lib/RT/Date.pm
+++ b/lib/RT/Date.pm
@@ -1159,7 +1159,7 @@ vice versa.
 
 sub DateTimeObj {
     my $self = shift;
-    my %args = ( 
+    my %args = (
         Timezone => '',
         @_,
     );
@@ -1179,8 +1179,25 @@ sub DateTimeObj {
         second     => $sec,
         nanosecond => 0,
     );
+}
+
+=head3 Strftime FORMAT, [Timezone => 'user']
+
+Stringify the RT::Date according to the specified format. See
+L<DateTime/strftime Patterns>.
+
+=cut
+
+sub Strftime {
+    my $self = shift;
+    my $format = shift;
+    my %args = (
+        Timezone => 'user',
+        @_,
+    );
 
-    return $dt;
+    my $dt = $self->DateTimeObj(%args);
+    return $dt->strftime($format);
 }
 
 RT::Base->_ImportOverlays();

commit 169665a10b018f6bc60e52b9b1de472bb1b65c82
Merge: 181d165 1f9624e
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Fri Dec 4 11:29:58 2015 -0500

    Merge branch '4.2/rt-date-strftime' into 4.4-trunk


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


More information about the rt-commit mailing list