[tw] Re: Datepicker skipping back a day?

2018-01-15 Thread passingby
Just for the record I have made a crude macro to overcome the timezone date 
display problem. In my case the date number string stored in my tiddler 
field named "date" like this: 201801150. Now for operations such as 
sorting there was no problem. Only thing was that when browser displayed 
the date it changed it according to my timezone. So all i wanted was to 
display the date as it was. So i made this macro: 

(function(){

"use strict";
exports.name = "myViewDate";
exports.params = [
{name: "dateValue"}
];

exports.run = function(dateValue) {
//2018011206000

var yr= dateValue.slice(0,4);
var mnth= dateValue.slice(4,6);
var mnthstr="";
var day= dateValue.slice(6,8);

switch (mnth) {
   case "01":
   mnthstr = "January";
   break;
   case "02":
   mnthstr= "February";
   break;
   case "03":
   mnthstr= "March";
   break;
   case "04":
   mnthstr= "April";
   break;
   case "05":
   mnthstr= "May";
   break;
   case "06":
   mnthstr= "June";
   break;
   case "07":
   mnthstr= "July";
   break;
   case "08":
   mnthstr= "August";
   break;
   case "09":
   mnthstr= "September";
   break;
   case "10":
   mnthstr= "October";
   break;
   case "11":
   mnthstr= "November";
   break;
   case "12":
   mnthstr= "December";
   break;
}

return day+" "+mnthstr+" "+yr;

};

})();



So wherever I needed to display the date I call this macro:

<$macrocall $name="myViewDate" dateValue={{!!date}} />

And this works for me. Just thought this might help somebody.





-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/4bebbe0c-aa54-49c3-aac1-3701301240cf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: Datepicker skipping back a day?

2018-01-13 Thread passingby
Is it possible to sort a list on multiple fields? I was thinking I could 
save a date on separate fields such as year, month and day. But then the 
next problem would be of sorting a list tiddler first on year and then 
month and then on day. Is it possible?


-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/56aa1a5c-bae4-4caa-ba32-058193473de1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: Datepicker skipping back a day?

2018-01-13 Thread Birthe C
I think you are experiencing, what I did yesterday. I saw the date set back 
i en field, but after having had to refresh my wiki, the date was right 
again. Browser refresh is what helps? (It would be so much more fun if it 
was Gandalf)

By the way I tested @Passingby suggestion, with UTC and without. About 1 
hour difference, and that should be correct in my case.


Birthe

Den lørdag den 13. januar 2018 kl. 18.57.01 UTC+1 skrev Pit.W.:
>
> Hi Tony,
>
> I had the same phenomen of skipping back a day. It disappeared after I 
> reinstalled the datepicker plugin. This worked with several TWs, both file 
> and node.
>
> Why? No clue. Gandalf? Dumbledore? Does software have selfhealing 
> capabilities?
>
> I do not use hours, just dates. If I test it with hours, I have a gap of 1 
> hr ( I am Greenwich +1). This is a phenomen which has been mentioned before 
> and is known.
>
>
> I would be interested to learn how you add or substract dates.
>
> Pit.W
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/c0eadb6f-716c-48de-84b7-a1b213e5a6d7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: Datepicker skipping back a day?

2018-01-13 Thread Pit.W.

Hi Tony,

I had the same phenomen of skipping back a day. It disappeared after I 
reinstalled the datepicker plugin. This worked with several TWs, both 
file and node.


Why? No clue. Gandalf? Dumbledore? Does software have selfhealing 
capabilities?


I do not use hours, just dates. If I test it with hours, I have a gap of 
1 hr ( I am Greenwich +1). This is a phenomen which has been mentioned 
before and is known.



I would be interested to learn how you add or substract dates.

Pit.W


Am 2018-01-13 um 01:44 schrieb TonyM:

Passingby,

For the record I have the same problem with a multiple date solution I 
have built and need an effective solution. I am at +10 and +11 in 
daylight savings time (DST). If I wish to add or subtract a date say 
to next week, yesterday or tomorrow, the result is not always friendly.


I would like to click into automatic DST, or have my current date/time 
reflect my browsers at all times,


Lets share our learnings.

Tony

On Friday, 12 January 2018 19:06:11 UTC+11, passingby wrote:

I just noticed something strange while playing around with
datepicker from here http://kixam.github.io/TW5-datePicker/


If i write <$edit-date> into a new tiddler and then let the view
render, and pick a date, it picks up the date and then right
before my eyes skips back by one day! So if i pick 12th of jan it
becomes 11th of january. Can anybody confirm this to be happening
or I am in need of sleep?

--
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 tiddlywiki+unsubscr...@googlegroups.com 
.
To post to this group, send email to tiddlywiki@googlegroups.com 
.

Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/4f348c78-c0cc-4e09-9a7d-3dc80d6a3599%40googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.




_

Ihre E-Mail-Postfächer sicher & zentral an einem Ort. Jetzt wechseln und alte 
E-Mail-Adresse mitnehmen! https://www.eclipso.de

--
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/ed3b86dd-259f-e0f5-5768-a885475d1de5%40eclipso.ch.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: Datepicker skipping back a day?

2018-01-12 Thread TonyM
Passingby,

For the record I have the same problem with a multiple date solution I have 
built and need an effective solution. I am at +10 and +11 in daylight 
savings time (DST). If I wish to add or subtract a date say to next week, 
yesterday or tomorrow, the result is not always friendly.

I would like to click into automatic DST, or have my current date/time 
reflect my browsers at all times,

Lets share our learnings.

Tony

On Friday, 12 January 2018 19:06:11 UTC+11, passingby wrote:
>
> I just noticed something strange while playing around with datepicker from 
> here http://kixam.github.io/TW5-datePicker/
>
> If i write <$edit-date> into a new tiddler and then let the view render, 
> and pick a date, it picks up the date and then right before my eyes skips 
> back by one day! So if i pick 12th of jan it becomes 11th of january. Can 
> anybody confirm this to be happening or I am in need of sleep?
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/4f348c78-c0cc-4e09-9a7d-3dc80d6a3599%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: Datepicker skipping back a day?

2018-01-12 Thread cmari
oops, I see you already reached my conclusion.

On Friday, January 12, 2018 at 12:13:44 PM UTC-8, cmari wrote:
>
> I noticed this some time ago and yes it is frustrating because I use the 
> datepicker daily. I could be wrong, but I have been assuming it is yet 
> another manifestation of the timezone "feature" that is not enough of a 
> "bug" to bother (or even be apparent to) TWers who live closer to 
> Greenwich. (See https://github.com/Jermolene/TiddlyWiki5/issues/2061). 
>
> On Friday, January 12, 2018 at 12:06:11 AM UTC-8, passingby wrote:
>>
>> I just noticed something strange while playing around with datepicker 
>> from here http://kixam.github.io/TW5-datePicker/
>>
>> If i write <$edit-date> into a new tiddler and then let the view render, 
>> and pick a date, it picks up the date and then right before my eyes skips 
>> back by one day! So if i pick 12th of jan it becomes 11th of january. Can 
>> anybody confirm this to be happening or I am in need of sleep?
>>
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/2de020e3-3652-4e4b-8996-7cbfdc5a0cfb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: Datepicker skipping back a day?

2018-01-12 Thread cmari
I noticed this some time ago and yes it is frustrating because I use the 
datepicker daily. I could be wrong, but I have been assuming it is yet 
another manifestation of the timezone "feature" that is not enough of a 
"bug" to bother (or even be apparent to) TWers who live closer to 
Greenwich. (See https://github.com/Jermolene/TiddlyWiki5/issues/2061). 

On Friday, January 12, 2018 at 12:06:11 AM UTC-8, passingby wrote:
>
> I just noticed something strange while playing around with datepicker from 
> here http://kixam.github.io/TW5-datePicker/
>
> If i write <$edit-date> into a new tiddler and then let the view render, 
> and pick a date, it picks up the date and then right before my eyes skips 
> back by one day! So if i pick 12th of jan it becomes 11th of january. Can 
> anybody confirm this to be happening or I am in need of sleep?
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/a0b667a1-7931-43ae-956f-0d20191f5f20%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: Datepicker skipping back a day?

2018-01-12 Thread Birthe C
Well now this has kept you awake, at least you were only one day behind. I 
am using the datepicker from GSD5. It does not like empty field and so I 
just put some zeroes - to be able to edit it from view mode without 
problems. I could do that, but before editing it showed 1899-11-30, but 
only zeroes in the field.

Birthe

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/a4b9c985-2f83-4be9-baed-407063bb1dde%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: Datepicker skipping back a day?

2018-01-12 Thread passingby
I think the solution has been given by jeremy but I am making a mistake 
implementing it. at tiddlywiki.com it says if we add [UTC] token to the 
format string it should shift the date to UTc which should effectively 
solve the problem.
[UTC] Time-shift the represented date to UTC. Must be at very start of 
format string 
.
But as I mentioned above its not happening for me. 

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/513515e4-9e0c-4081-b567-f83ce6b92de7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: Datepicker skipping back a day?

2018-01-12 Thread passingby


On Friday, January 12, 2018 at 12:21:18 PM UTC-7, Sander Datema wrote:
>
> Can't be sure if you need more sleep, but I cannot reproduce what you 
> describe I'm afraid.
>
> I found the cause. Its due to my timezone. The dates are stored in UTC but 
when rendered they are rendered as browser timezone. So any date which has 
9 zeros at the end like: 201801120 is saved as such but when 
displayed in a date format skips back by one day and is displayed as 11 
january 2018. If I add my timezone difference to the date string it then 
displayes the correct day. My timezone is canada mountain time which is 7 
hours ahead. So  2018011207000 displays the day as 12th.

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/959529d5-b4b7-4a25-9e9b-769014240b7a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: Datepicker skipping back a day?

2018-01-12 Thread coda coder



It's definitely a problem:




On Friday, January 12, 2018 at 1:21:18 PM UTC-6, Sander Datema wrote:
>
> Can't be sure if you need more sleep, but I cannot reproduce what you 
> describe I'm afraid.
>
> Op vrijdag 12 januari 2018 09:06:11 UTC+1 schreef passingby:
>>
>> I just noticed something strange while playing around with datepicker 
>> from here http://kixam.github.io/TW5-datePicker/
>>
>> If i write <$edit-date> into a new tiddler and then let the view render, 
>> and pick a date, it picks up the date and then right before my eyes skips 
>> back by one day! So if i pick 12th of jan it becomes 11th of january. Can 
>> anybody confirm this to be happening or I am in need of sleep?
>>
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/3b735195-009d-4cc5-ab3e-c0197497b7f5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: Datepicker skipping back a day?

2018-01-12 Thread Sander Datema
Can't be sure if you need more sleep, but I cannot reproduce what you 
describe I'm afraid.

Op vrijdag 12 januari 2018 09:06:11 UTC+1 schreef passingby:
>
> I just noticed something strange while playing around with datepicker from 
> here http://kixam.github.io/TW5-datePicker/
>
> If i write <$edit-date> into a new tiddler and then let the view render, 
> and pick a date, it picks up the date and then right before my eyes skips 
> back by one day! So if i pick 12th of jan it becomes 11th of january. Can 
> anybody confirm this to be happening or I am in need of sleep?
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/94df15da-ce2b-466f-abc4-299c4a52462f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: Datepicker skipping back a day?

2018-01-12 Thread passingby


On Friday, January 12, 2018 at 1:06:11 AM UTC-7, passingby wrote:
>
> I just noticed something strange while playing around with datepicker from 
> here http://kixam.github.io/TW5-datePicker/
>
> If i write <$edit-date> into a new tiddler and then let the view render, 
> and pick a date, it picks up the date and then right before my eyes skips 
> back by one day! So if i pick 12th of jan it becomes 11th of january. Can 
> anybody confirm this to be happening or I am in need of sleep?
>

I think I have found out the problem, and it has nothing to do with the 
date picker plugin. It has something to do with the fact that TW stores 
dates in UTC but when rendering, the dates are rendered as the browser 
specific timezone. The problem now becomes, how to prevent this. How to 
make the tiddler display the date as it is stored in the field rather than 
shifting it to the local timezone? Tiddlywiki.com says attach [UTC] in the 
very front of the format string should keep the date to UTC.


[UTC] Time-shift the represented date to UTC. Must be at very start of 
format string


But this is doing nothing for me:
if i have a field asdf with the value as 201801120 and get it to 
display with this:
<$view field="asdf" format="date" template="[UTC]DD MMM "/>
the date skips by one day and displays as:
[UTC]11 January 2018

 

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/01b5f70c-4392-43a2-b7f3-8b14398650e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.