[nanny: 9/13] Fix datetime caculation bug in notification service.



commit 3317a42a566ddb1f55d838763cb733fc954477d6
Author: Guido Tabbernuk <boamaod gmail com>
Date:   Wed Feb 29 23:50:12 2012 +0200

    Fix datetime caculation bug in notification service.

 client/gnome/systray/src/SystrayNanny.py |    4 ++--
 po/et.po                                 |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/client/gnome/systray/src/SystrayNanny.py b/client/gnome/systray/src/SystrayNanny.py
index 28b973d..fb1f137 100755
--- a/client/gnome/systray/src/SystrayNanny.py
+++ b/client/gnome/systray/src/SystrayNanny.py
@@ -112,9 +112,9 @@ class SystrayNanny(gtk.StatusIcon):
             # a bit messy right now
             # this should probably be a special function in QuarterBack
             # is_blocked now deals only with scheduled blocks
-            minutes_till_midnight = int((datetime.now().replace(day=datetime.now().day+1, minute=0, hour=0, second=0, microsecond=0) - datetime.now()).seconds/60)
+            minutes_till_midnight = int(((datetime.now()+timedelta(days=1)).replace(minute=0, hour=0, second=0, microsecond=0) - datetime.now()).seconds/60)
             if (datetime.now() + timedelta(minutes=available_time)).day != datetime.now().day:
-                available_time = minutes_till_midnight + self.dbus.get_max_use_time(userid, appid)
+                available_time = minutes_till_midnight + self.dbus.get_max_use_time(user_id, app_id)
             elif available_time == 0:
                 if (next_change == -1 or (next_change > minutes_till_midnight and block_status == True)):
                     next_change = minutes_till_midnight
diff --git a/po/et.po b/po/et.po
index 600d4aa..9155588 100644
--- a/po/et.po
+++ b/po/et.po
@@ -726,7 +726,7 @@ msgid ""
 "Click this button if you want to make changes."
 msgstr ""
 "<b>HaldusÃigused pole hetkel tarvitusel</b>\n"
-"Muudatuste tegemiseks vajuta sellele nupule."
+"Muudatuste tegemiseks vajuta sellele nupule"
 
 #: ../client/gnome/admin/data/ui/nanny_admin_console.ui.h:4
 msgid "Configure _chores & rewards"



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]