[Commits] (alecf) fix bug 2819 - show single-digit hours when appropriate

commits at osafoundation.org commits at osafoundation.org
Tue Apr 12 14:47:29 PDT 2005


Commit by: alecf
Modified files:
chandler/parcels/osaf/framework/blocks/calendar/CalendarCanvas.py 1.60 1.61

Log message:
fix bug 2819 - show single-digit hours when appropriate

Bugzilla links:
http://bugzilla.osafoundation.org/show_bug.cgi?id=2819

ViewCVS links:
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/blocks/calendar/CalendarCanvas.py.diff?r1=text&tr1=1.60&r2=text&tr2=1.61

Index: chandler/parcels/osaf/framework/blocks/calendar/CalendarCanvas.py
diff -u chandler/parcels/osaf/framework/blocks/calendar/CalendarCanvas.py:1.60 chandler/parcels/osaf/framework/blocks/calendar/CalendarCanvas.py:1.61
--- chandler/parcels/osaf/framework/blocks/calendar/CalendarCanvas.py:1.60	Tue Apr 12 14:24:03 2005
+++ chandler/parcels/osaf/framework/blocks/calendar/CalendarCanvas.py	Tue Apr 12 14:47:28 2005
@@ -1,8 +1,8 @@
 """ Canvas for calendaring blocks
 """
 
-__version__ = "$Revision: 1.60 $"
-__date__ = "$Date: 2005/04/12 21:24:03 $"
+__version__ = "$Revision: 1.61 $"
+__date__ = "$Date: 2005/04/12 21:47:28 $"
 __copyright__ = "Copyright (c) 2004 Open Source Applications Foundation"
 __license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -329,9 +329,10 @@
             
             # only draw date/time on first item
             if drawTime:
-                
-                # only draw time if there is room
-                timeString = time.Format('%I:%M %p').lower()
+                # amazingly, there is no hour-without-the-zero in mx.DateTime!
+                # (If anyone knows a better way to do this, please fix..)
+                hour = str(int(time.Format('%I')))
+                timeString = hour + time.Format(':%M %p').lower()
                 te = dc.GetFullTextExtent(timeString, brushContainer.smallBoldFont)
                 timeHeight = te[1]
                 



More information about the Commits mailing list