[folks] From Patrick Ohly <patrick ohly intel com>



commit e804cb24d87a5a190d83d8450861f06fa2211592
Author: Jeremy Whiting <jpwhiting kde org>
Date:   Fri Oct 26 14:21:09 2012 -0600

    From Patrick Ohly <patrick ohly intel com>
    
    Reading converts from date-only to local time to UTC. Writing must do
    the same conversion. Conversion from UTC to local time was missing,
    therefore the date may have gotten shifted by a day (depending on the
    local time zone).
    
    This commit intentionally does not cache the local time zone (like
    reading does), because this is a bit ugly and the assumption is that
    writing occurs a lot less often than reading.
    
    Closes: https://bugzilla.gnome.org/show_bug.cgi?id=686693

 NEWS                                     |    1 +
 backends/eds/lib/edsf-persona-store.vala |    7 ++++---
 2 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/NEWS b/NEWS
index e1f1018..12a6ffc 100644
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,7 @@ Bugs fixed:
 â Bug 685250 â make <test>.gdb deadlocks
 â Bug 686674 â Tracker backend doesn't implement new Backend functions
 â Bug 686506 â Make zeitgeist dependency optional again
+â Bug 686693 â writing birthday lacks conversion from UTC
 
 API changes:
 â Add Backend.enable_persona_store and disable_persona_store.
diff --git a/backends/eds/lib/edsf-persona-store.vala b/backends/eds/lib/edsf-persona-store.vala
index adc2c1c..5d96015 100644
--- a/backends/eds/lib/edsf-persona-store.vala
+++ b/backends/eds/lib/edsf-persona-store.vala
@@ -1829,12 +1829,13 @@ public class Edsf.PersonaStore : Folks.PersonaStore
       if (_bday != null)
         {
           var bday = (!) _bday;
+          var bdaylocal = bday.to_local();
           E.ContactDate contact_bday;
 
           contact_bday = new E.ContactDate ();
-          contact_bday.year = (uint) bday.get_year ();
-          contact_bday.month = (uint) bday.get_month ();
-          contact_bday.day = (uint) bday.get_day_of_month ();
+          contact_bday.year = (uint) bdaylocal.get_year ();
+          contact_bday.month = (uint) bdaylocal.get_month ();
+          contact_bday.day = (uint) bdaylocal.get_day_of_month ();
 
           _contact_bday = contact_bday;
         }



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