[Rt-commit] r18869 - rt/3.999/branches/datetime/share/html/Elements

sartak at bestpractical.com sartak at bestpractical.com
Thu Mar 19 17:19:36 EDT 2009


Author: sartak
Date: Thu Mar 19 17:19:36 2009
New Revision: 18869

Modified:
   rt/3.999/branches/datetime/share/html/Elements/SelectDate

Log:
More SelectDate fixes

Modified: rt/3.999/branches/datetime/share/html/Elements/SelectDate
==============================================================================
--- rt/3.999/branches/datetime/share/html/Elements/SelectDate	(original)
+++ rt/3.999/branches/datetime/share/html/Elements/SelectDate	Thu Mar 19 17:19:36 2009
@@ -48,15 +48,14 @@
 <input type="text" id="<% $name %>" name="<% $name %>" class="datetime" value="<% $value %>" size="<% $size %>" />
 <%init>
 undef $default if ref($default) && !$default->is_set;
+undef $value   if ref($value)   && !$value->is_set;
 
 if (!defined($default) && $current > 0) {
-	my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
-                                            localtime($current);
-        $default = sprintf("%04d-%02d-%02d %02d:%02d",                         
-                           $year+1900,$mon+1,$mday,                            
-                           $hour,$min);   
+    $default = RT::DateTime->from_epoch($current);
 }
+
 $value = $value || $default;
+$value = $value->iso if ref($value);
 
 unless ($name) {
 	$name = $menu_prefix. "_date";


More information about the Rt-commit mailing list