[clocks] Fix the clock format bug
- From: Seif Lotfy <seiflotfy src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clocks] Fix the clock format bug
- Date: Wed, 13 Jun 2012 16:10:55 +0000 (UTC)
commit e6df085d90dc0a0ba828589975af18985d632a91
Author: Eslam Mostafa <cseslam gmail com>
Date: Wed Jun 13 17:53:43 2012 +0200
Fix the clock format bug
Signed-off-by: Seif Lotfy <seif lotfy com>
widgets.py | 12 ++----------
1 files changed, 2 insertions(+), 10 deletions(-)
---
diff --git a/widgets.py b/widgets.py
index 92ffd8b..9eda245 100644
--- a/widgets.py
+++ b/widgets.py
@@ -138,17 +138,9 @@ class DigitalClock ():
if not t == self._last_time:
systemClockFormat = self.get_system_clock_format ()
if systemClockFormat == '12h':
- pass
+ t = time.strftime("%I:%M %p", self.get_local_time ())
else:
- #Convert to 24h
- hours = t[0:2]
- hours = int(hours)+12
- if hours == 24:
- hours = '00'
- else:
- hours = str(hours)
- minutes = t[3:5]
- t = '%s:%s' % (hours, minutes)
+ t = time.strftime("%H:%M", self.get_local_time ()) #Convert to 24h
img = self.get_image ()
self.drawing.render(t, img, self.get_is_day ())
if self.view_iter and self.list_store:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]