[Bps-public-commit] r14220 - in Data-Plist: .

alexmv at bestpractical.com alexmv at bestpractical.com
Thu Jul 17 12:46:04 EDT 2008


Author: alexmv
Date: Thu Jul 17 12:45:57 2008
New Revision: 14220

Modified:
   Data-Plist/   (props changed)
   Data-Plist/lib/Data/Plist/Writer.pm

Log:
 r34290 at kohr-ah:  chmrr | 2008-07-17 12:45:47 -0400
  * Teach serialize_value about DateTimes


Modified: Data-Plist/lib/Data/Plist/Writer.pm
==============================================================================
--- Data-Plist/lib/Data/Plist/Writer.pm	(original)
+++ Data-Plist/lib/Data/Plist/Writer.pm	Thu Jul 17 12:45:57 2008
@@ -68,6 +68,8 @@
             return [ dict => \%hash ];
         } elsif ($value->isa("Foundation::NSObject")) {
             return $value->serialize;
+        } elsif ($value->isa("DateTime")) {
+            return [ date => $value->epoch - 978307200 + $value->nanosecond / 1e9 ];
         } else {
             die "Can't serialize unknown ref @{[ref $value]}\n";
         }



More information about the Bps-public-commit mailing list