On Friday, September 4, 2020 at 10:49:46 PM UTC-7, TW Tones wrote:
>
> *Example of current timezone related issue.*
> I see this date issue as well see the image, I went to add a note for 
> Christmas day, I live at +10 GMT/UTC, I selected 24th in this snapshot.
>

I *think* I fixed the timezone issue.  If I'm right, it was related the 
parameter used in the sameday[D] filter:

The documentation at https://tiddlywiki.com/#sameday%20Operator says:

>
> *parameter D = a date, in the format YYYYMMDD**D may include a time of 
> day, but this is ignored.*


However, if you don't provide a time of day (or use all zeros), then the 
filter seems sensitive to timezone offset.
I suspect that Jeremy didn't notice a problem since he is located in 
London, which is naturally UTC+0

Here's my OLD code that went wrong:
   <$vars  month={{{ [[$mm$]addprefix[0]split[]last[2]join[]] }}}>
   <$vars    day={{{ [<dd>add[1]addprefix[0]split[]last[2]join[]]   }}}>
   <$vars  today={{{ [[$yyyy$]addsuffix<month>addsuffix<day>] }}}>
Note the "add[1]" in the day calculation.  This was a "magical mystery 
hack" that seemed to work for UTC-7 (my current timezone in California), 
but apparently not for other timezones such as UTC+2 (Birthe) or UTC+10 
(Tony)

and here's the NEW code:
   <$vars  month={{{ [[$mm$]addprefix[0]split[]last[2]join[]] }}}>
   <$vars    day={{{ [<dd>addprefix[0]split[]last[2]join[]]   }}}>
   <$vars  today={{{ 
[[$yyyy$]addsuffix<month>addsuffix<day>addsuffix[120000000]] 
}}}>
Note the removal of the "add[1]" in the "day" calculation, and the addition 
of addsuffix[120000000] (i.e., "noon" for UTC+0) in the "today"

This change still gives the correct results for my timezone (YAY!) and, I 
hope, will now also be correct for all other timezones (i.e., everything 
from UTC-12 through UTC+12)

However, I can't really be sure until you both (Birthe and Tony) test it!

Please download the update from
http://tiddlytools.com/timer.html#TiddlyTools%2FTimer%2FCalendar
and let me know if it actually does fix the problem.

Awaiting your response with bated breath...

-e

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/5b4e1e4d-1cc9-458a-b53a-ac9c30550e79o%40googlegroups.com.

Reply via email to