webOS Nation Forums >  Homebrew >  webOS Patches > Fix Facebook timezone problems
Fix Facebook timezone problems
  Reply
 
Thread Tools Display Modes
Old 04/12/2012, 03:30 AM   #1 (permalink)
Homebrew Developer
 
hape's Avatar
 
Posts: 556
Hi Frantid,

there is a bug in the Facebook synergy service since webos 1.3 that never has been fixed. The result of this bug is that all calendar events that are synced from facebook are stored in the calendar database with the UTC time zone.
Facebook Calendar Sync: Time offset issue? - Support Community

The result is that all events in the calendar move the number of hours that your time zone is away from UTC. I live in GMT+1, so all Facebooke events move 6 hours into the future.

Would it be possible to include a workaround for this problem into the ‹bercalendar patch? I expect you can check if an event is from the Facebook calendar and add the number of hours that the users time zone is away from UTC.

In the screen shot below you see the result. The green entry is from facebook and the pink entry is manually entered at the correct date.
Attached Images
File Type: png calendar_2012-10-04_163109.png (121.1 KB, 37 views) Email Attachment
hape is offline   Reply With Quote
Old 04/12/2012, 07:29 AM   #2 (permalink)
Member
 
Posts: 2,661
Quote:
Originally Posted by HaPe View Post
Hi Frantid,

there is a bug in the Facebook synergy service since webos 1.3 that never has been fixed. The result of this bug is that all calendar events that are synced from facebook are stored in the calendar database with the UTC time zone.
Facebook Calendar Sync: Time offset issue? - Support Community

The result is that all events in the calendar move the number of hours that your time zone is away from UTC. I live in GMT+1, so all Facebooke events move 6 hours into the future.

Would it be possible to include a workaround for this problem into the ‹bercalendar patch? I expect you can check if an event is from the Facebook calendar and add the number of hours that the users time zone is away from UTC.

In the screen shot below you see the result. The green entry is from facebook and the pink entry is manually entered at the correct date.
I'd have to patch pretty deep in the calendar service, I'm not sure if it would work correctly for alarms, etc.

If you go into the event and look at the timezone settings, by pushing the change timezone button. What timezone does it say for the event?
__________________
French Pre3, UK Pre2, US Veer, German gsm Pre, 680, garmin ique 3600 & still have my working palm pilot 1000 with the 1 Mb adapter

Please remove UberCalendar and google sync behavior patches prior to system updates.
patch Google calendar sync behavior for 2.x.x and TouchPad (Tweaks enabled)
Preference guide for MetaView's UberCalendar patch
frantid is offline   Reply With Quote
Old 04/12/2012, 08:27 AM   #3 (permalink)
Homebrew Developer
 
hape's Avatar
 
Posts: 556
Quote:
Originally Posted by frantid View Post
I'd have to patch pretty deep in the calendar service, I'm not sure if it would work correctly for alarms, etc.

If you go into the event and look at the timezone settings, by pushing the change timezone button. What timezone does it say for the event?
Hi,

the Facebook events are read only. Is there a way to lookup the time zone for a read only event? I only know the button on the edit screen.

HaPe
hape is offline   Reply With Quote
Old 04/12/2012, 08:34 AM   #4 (permalink)
Member
 
Posts: 2,661
Quote:
Originally Posted by HaPe View Post
Hi,

the Facebook events are read only. Is there a way to lookup the time zone for a read only event? I only know the button on the edit screen.

HaPe
ok, I didn't know that. I thought facebook put all things in the pacific timezone. I'm not sure about how to fix it now. I don't have a facebook account to test it with.
__________________
French Pre3, UK Pre2, US Veer, German gsm Pre, 680, garmin ique 3600 & still have my working palm pilot 1000 with the 1 Mb adapter

Please remove UberCalendar and google sync behavior patches prior to system updates.
patch Google calendar sync behavior for 2.x.x and TouchPad (Tweaks enabled)
Preference guide for MetaView's UberCalendar patch
frantid is offline   Reply With Quote
Old 04/12/2012, 01:50 PM   #5 (permalink)
Member
 
Posts: 2,661
Quote:
Originally Posted by HaPe View Post
Hi Frantid,

there is a bug in the Facebook synergy service since webos 1.3 that never has been fixed. The result of this bug is that all calendar events that are synced from facebook are stored in the calendar database with the UTC time zone.
Facebook Calendar Sync: Time offset issue? - Support Community

The result is that all events in the calendar move the number of hours that your time zone is away from UTC. I live in GMT+1, so all Facebooke events move 6 hours into the future.

Would it be possible to include a workaround for this problem into the ‹bercalendar patch? I expect you can check if an event is from the Facebook calendar and add the number of hours that the users time zone is away from UTC.

In the screen shot below you see the result. The green entry is from facebook and the pink entry is manually entered at the correct date.
Try this patch out. I'm curious if it will work for you. Toggle your facebook calendar off. You have to install it, restart luna. Then toggle your facebook calendar on.

Let me know how it goes. I set it to Europe/Zurich.
__________________
French Pre3, UK Pre2, US Veer, German gsm Pre, 680, garmin ique 3600 & still have my working palm pilot 1000 with the 1 Mb adapter

Please remove UberCalendar and google sync behavior patches prior to system updates.
patch Google calendar sync behavior for 2.x.x and TouchPad (Tweaks enabled)
Preference guide for MetaView's UberCalendar patch

Last edited by frantid; 04/12/2012 at 04:56 PM.
frantid is offline   Reply With Quote
Old 04/12/2012, 03:40 PM   #6 (permalink)
Homebrew Developer
 
hape's Avatar
 
Posts: 556
Quote:
Originally Posted by frantid View Post
Try this patch out. I'm curious if it will work for you. Toggle your facebook calendar off. You have to install it, restart luna. Then toggle your facebook calendar on.

Let me know how it goes. I set it to Europe/Zurich.
Thanks for looking into it. The patch was promising but the event was recreated at the same time as it was before. I did a full device restart after installing the patch and before reactivating the calendar.

HaPe
hape is offline   Reply With Quote
Old 04/12/2012, 04:19 PM   #7 (permalink)
Member
 
Posts: 2,661
Quote:
Originally Posted by HaPe View Post
Thanks for looking into it. The patch was promising but the event was recreated at the same time as it was before. I did a full device restart after installing the patch and before reactivating the calendar.

HaPe
That's too bad, what if you create a new event on facebook?
__________________
French Pre3, UK Pre2, US Veer, German gsm Pre, 680, garmin ique 3600 & still have my working palm pilot 1000 with the 1 Mb adapter

Please remove UberCalendar and google sync behavior patches prior to system updates.
patch Google calendar sync behavior for 2.x.x and TouchPad (Tweaks enabled)
Preference guide for MetaView's UberCalendar patch
frantid is offline   Reply With Quote
Old 04/12/2012, 04:56 PM   #8 (permalink)
Member
 
Posts: 2,661
Quote:
Originally Posted by HaPe View Post
Thanks for looking into it. The patch was promising but the event was recreated at the same time as it was before. I did a full device restart after installing the patch and before reactivating the calendar.

HaPe
I found another reference, try this new one.
__________________
French Pre3, UK Pre2, US Veer, German gsm Pre, 680, garmin ique 3600 & still have my working palm pilot 1000 with the 1 Mb adapter

Please remove UberCalendar and google sync behavior patches prior to system updates.
patch Google calendar sync behavior for 2.x.x and TouchPad (Tweaks enabled)
Preference guide for MetaView's UberCalendar patch

Last edited by frantid; 04/13/2012 at 07:04 AM.
frantid is offline   Reply With Quote
Thanked By: HaPe
Old 04/12/2012, 06:37 PM   #9 (permalink)
Homebrew Developer
 
hape's Avatar
 
Posts: 556
Quote:
Originally Posted by frantid View Post
I found another reference, try this new one.
strike, got it working. Thanks for pointing me into the right direction. I added one more setting of the time zone in the type.js (not sure if that is really needed) and manually shifted the time -9 hours in the on.event.js

Now all events are at the right place. The attached file should work for all in time zone Europe/Berlin (= Europe/Zurich).

To create a general resolution we would need to move the time zone into a variable or get the current webOS time zone setting and calculate the number of hours that it needs to be shifted from America/Los_Angeles. Not sure if this is possible?

The only other way would be to create a patch per time zone....

HaPe

[edit] 13.Apr: new patch file, the old one had a bug sorry [/edit]
Attached Files
File Type: patch facebook.patch (2.7 KB, 9 views) Email Attachment

Last edited by HaPe; 04/13/2012 at 01:53 AM.
hape is offline   Reply With Quote
Thanked By: frantid
Old 04/13/2012, 02:53 AM   #10 (permalink)
pivotCE Developer
 
Posts: 2,191
Guys that Facebook quickfix would be great. Something webOs users are waiting since at least 2 years. I'll try it in the evening, i'm on Europe/Berlin as well

Perhaps this could be made tweakable as separate patch with Timezones to be selected.

Am i correct that this patch is only changing facebook calendar timezone entries and not systemwide or other calendars entries?

So the only drawback would be that facebook Events that are made for another timezone than your (perhaps from uncles abroard ) would then also show up as your timezone. But hey they were also wrong before, so no loss and much win for events in own timezone.
gizmo21 is offline   Reply With Quote
Thanked By: frantid
Old 04/13/2012, 03:31 AM   #11 (permalink)
Homebrew Developer
 
hape's Avatar
 
Posts: 556
Quote:
Originally Posted by gizmo21 View Post
Guys that Facebook quickfix would be great. Something webOs users are waiting since at least 2 years. I'll try it in the evening, i'm on Europe/Berlin as well

Perhaps this could be made tweakable as separate patch with Timezones to be selected.

Am i correct that this patch is only changing facebook calendar timezone entries and not systemwide or other calendars entries?

So the only drawback would be that facebook Events that are made for another timezone than your (perhaps from uncles abroard ) would then also show up as your timezone. But hey they were also wrong before, so no loss and much win for events in own timezone.
It only adds the European timezone to th facebook entires instead of the American time zone and shift the time by -9 hours. This happens when the events are synced down from facebook to your webOS calendar.

I'm shaking my head why this never has been fixed as it was that easy after franit pointed me into the right direction. OK, a world wide solution is more complex but should be possible.
The code would need to lookup the local user time zone, add this to the entries instead of the hard coded America one and shift the time by the difference between this both time zones.

I guess that also entries from other time zones could be correct, as facebook do not deliver any time zone information. I expect that they store the data internal with one fixed time zone (the one they send the entry's in) and only translates them to the users time zone when they are displayed in the webpage.

HaPe

HaPe
hape is offline   Reply With Quote
Thanked By: frantid
Old 04/13/2012, 06:35 AM   #12 (permalink)
Member
 
Posts: 2,661
You guys got me thinking. I think I approached it wrong. Can you try this one?

I think Palm had the right idea in labeling the timezone as America\Pacific. The problem as HaPe pointed out is that facebook is sending everything in Local time of the user. Therefore, the time needs to be converted back to Pacific and labeled as Pacific, so the normal calendar processing can take care of it. It will then be able to handle DST changes and different timezones.

I am curious to see what happens when the device changes timezones, if the events will then be correct...

I suppose we should move to a different thread, my apologies for the off topic.

edit: had to fix an error use facebook2.patch
__________________
French Pre3, UK Pre2, US Veer, German gsm Pre, 680, garmin ique 3600 & still have my working palm pilot 1000 with the 1 Mb adapter

Please remove UberCalendar and google sync behavior patches prior to system updates.
patch Google calendar sync behavior for 2.x.x and TouchPad (Tweaks enabled)
Preference guide for MetaView's UberCalendar patch

Last edited by frantid; 04/13/2012 at 11:16 AM.
frantid is offline   Reply With Quote
Old 04/13/2012, 10:22 AM   #13 (permalink)
pivotCE Developer
 
Posts: 2,191
i uninstalled all facebook patches prior to applying the above facebook2.patch (which is only changing the on.event.js) and this patch prevents adding the facebook calendar account at all.
gizmo21 is offline   Reply With Quote
Thanked By: frantid
Old 04/13/2012, 10:25 AM   #14 (permalink)
Member
 
Posts: 2,661
must be an error I'll double check it
frantid is offline   Reply With Quote
Old 04/13/2012, 11:15 AM   #15 (permalink)
Member
 
Posts: 2,661
Quote:
Originally Posted by gizmo21 View Post
i uninstalled all facebook patches prior to applying the above facebook2.patch (which is only changing the on.event.js) and this patch prevents adding the facebook calendar account at all.
I forgot to remove a ","

doh.

edit: hmm I'm getting a reference error. I'm going to have to debug this.
__________________
French Pre3, UK Pre2, US Veer, German gsm Pre, 680, garmin ique 3600 & still have my working palm pilot 1000 with the 1 Mb adapter

Please remove UberCalendar and google sync behavior patches prior to system updates.
patch Google calendar sync behavior for 2.x.x and TouchPad (Tweaks enabled)
Preference guide for MetaView's UberCalendar patch

Last edited by frantid; 04/13/2012 at 12:44 PM.
frantid is offline   Reply With Quote
Old 04/13/2012, 11:57 AM   #16 (permalink)
pivotCE Developer
 
Posts: 2,191
you commented out a lot. is there perhaps a problem with tzm you commented out and using in a later line tzm.timezone.
(not that i'm a big coder, but i seemed weird to me)

btw. for which webosversion, this is for
i'm testing on 2.2.4

Last edited by gizmo21; 04/13/2012 at 12:10 PM.
gizmo21 is offline   Reply With Quote
Old 04/13/2012, 12:44 PM   #17 (permalink)
Member
 
Posts: 2,661
Quote:
Originally Posted by gizmo21 View Post
you commented out a lot. is there perhaps a problem with tzm you commented out and using in a later line tzm.timezone.
(not that i'm a big coder, but i seemed weird to me)

btw. for which webosversion, this is for
i'm testing on 2.2.4
I had to comment out that part. They overrode the normal function with filler code that doesn't convert any times.

I found my error, I was just going too fast.

version 4 attached. I tested with my wife's facebook account seems to work.

It should work on 2.2.4, and 3.0.5. I haven't checked other versions. It won't work on 1.4.5.
Attached Files
File Type: patch facebook4.patch (2.6 KB, 26 views) Email Attachment
__________________
French Pre3, UK Pre2, US Veer, German gsm Pre, 680, garmin ique 3600 & still have my working palm pilot 1000 with the 1 Mb adapter

Please remove UberCalendar and google sync behavior patches prior to system updates.
patch Google calendar sync behavior for 2.x.x and TouchPad (Tweaks enabled)
Preference guide for MetaView's UberCalendar patch

Last edited by frantid; 04/13/2012 at 12:55 PM.
frantid is offline   Reply With Quote
Thanked by Grabber5.0, HaPe
Old 04/13/2012, 02:13 PM   #18 (permalink)
pivotCE Developer
 
Posts: 2,191
Version 4 works on my 2.2.4 great.
Events that were one day off before, are exactly where they should have been.

Thank you so much for this fix, please bring it to preware. So many have been waiting for this since years.

Guys please donate to frantid and HaPe, cause they did what neither Palm nor HP could do.
__________________
Patch Enhancing vCard Export -|- Your own cloud with Zarafa (EAS sync) -|-
Tasks-app of 2.x on 3.x incl.EAS sync -|- SYM key in Enyo on phones -|- My hidden webOS Tips and Tricks - like it ?
gizmo21 is offline   Reply With Quote
Thanked By: frantid
Old 04/13/2012, 02:57 PM   #19 (permalink)
Homebrew Developer
 
hape's Avatar
 
Posts: 556
Hi Frantid,

you did it again. Thanks for your support. Works for me on the Pre3 (2.2.4) and the TP (3.0.5) from Germany.

HaPe
hape is offline   Reply With Quote
Thanked By: frantid
Old 04/13/2012, 03:44 PM   #20 (permalink)
Member
 
xandros9's Avatar
 
Posts: 911
importing the fb account into google calendar also works
__________________
HP Think Beyond Event - http://youtu.be/VnjwG7Z8AM8
m505 > Z|71 > T|C > Z|71 > T|T3 > LifeDrive > iPod touch 4
> Pre 2 > Treo Pro > Aria > HD2 > Treo 650 > Lumia 920
My OneDrive referral link: OneDrive
xandros9 is offline   Reply With Quote
Reply

 

Thread Tools
Display Modes



 


Content Relevant URLs by vBSEO 3.6.0