[hamster-applet/gnome-2-28] backported the zero date warning



commit ae0f33cd65353a8533e7f3ed7df3d538d415a2e0
Author: Toms Bauģis <toms baugis gmail com>
Date:   Sat Jan 23 17:01:31 2010 +0000

    backported the zero date warning

 hamster/widgets.py |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/hamster/widgets.py b/hamster/widgets.py
index c0f5ec6..faa314d 100644
--- a/hamster/widgets.py
+++ b/hamster/widgets.py
@@ -142,7 +142,7 @@ class DateInput(gtk.Entry):
     def _on_key_press_event(self, entry, event):
         if self.popup.get_property("visible"):
             cal_date = self.date_calendar.get_date()
-            date = dt.date(cal_date[0], cal_date[1], cal_date[2])
+            date = dt.date(cal_date[0], cal_date[1] + 1, cal_date[2])
         else:
             date = self._figure_date(entry.get_text())
             if not date:
@@ -169,9 +169,9 @@ class DateInput(gtk.Entry):
             self.prev_cal_day = "borken"
         else:
             #prev_cal_day is our only way of checking that date is right
-            self.prev_cal_day = date.day 
-        
-        self.date_calendar.select_month(date.month, date.year)
+            self.prev_cal_day = date.day
+
+        self.date_calendar.select_month(date.month - 1, date.year)
         self.date_calendar.select_day(date.day)
         return True
 



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