This is JFFortierQC's Typepad Profile.
Join Typepad and start following JFFortierQC's activity
Join Now!
Already a member? Sign In
JFFortierQC
Recent Activity
I've never changed code in github before. I just did it in your file. let me know if that was the way you wanted. hope that help!
Toggle Commented Aug 11, 2012 on WSSE for JavaScript at Blogging in the wind
1 reply
Nice Script But have a suggestion for a small update on it, more specifically in the isodatetime method. At the line 313, you get the difference between the current hour and the UTC hour. That woks most of the time but there is some specific moment where it does not give the right result. Note that JS return hour base on 24 hours not 12am and 12pm in this case. Here is the explanation: Any town where the difference is -4. It works all the time except between 8pm and midnight. Anytime : hour - hourUTC = -4 At 8pm : 20 - 00 = 20 At 9pm : 21 - 01 = 20 ... Same thing for any other minus number, as example difference of -8. Anytime : hour - hourUTC = -8 At 8pm : 16 - 00 = 16 At 9pm : 21 - 05 = 16 ... You can change value for city with different time like -6 or -11, you'll face the problem, but at different time of the day, when the UTC get at 00 and up to the time where the current hour reach midnight itself. The same problem for the positive difference, but at different time again. As example, +11 Anytime : hour - hourUTC = +11 At 8pm : 10 - 23 = -13 At 9pm : 11 - 24 = -13 ... To fix that, we can just add this in the code : var diff = hour - hourUTC; // That's ok if(diff > 12) diff -= 24; // Fix the problem for town with real negative diff if(diff <= -12) diff += 24; // Fix the problem for town with real positive diff Note that this have been done and test fast. May be someone may optimize it. For example, it does not take into account some exception of a specific places in the World where the difference is 13 or the other place where the difference is 12 3/4. Here is a map reference of it: http://www.srh.noaa.gov/jetstream/synoptic/timezones.htm Just select 24 hour in the top of it, unchek the Full Map option at the bottom and check the Off hours at the bottom. You'll see the weird time zone exception. We face the problem and fix it because of the server that refused or WSSE connection based on the fact that timezone was not right. Server restriction in our case validate timezone in the WSSE header for many reasons. Hope that can help.
Toggle Commented Aug 10, 2012 on WSSE for JavaScript at Blogging in the wind
1 reply
JFFortierQC is now following The Typepad Team
Aug 10, 2012