gcalcli icon indicating copy to clipboard operation
gcalcli copied to clipboard

Agenda seems to be confused about which events are from "today", possible timezone issue

Open beardedfool opened this issue 6 years ago • 4 comments

Sorry. I must be missing something. Trying to get today's agenda, I'm getting a missing appointment at 7am

X@X:~ $ gcalcli agenda

Mon Oct 07 Reoccuring

Wed Oct 09 birthday 7:00am Wake -# This goes missing 3:00pm testing caladd

Thu Oct 10
7:00am Wake 10:00am another normal entry # This also goes missing

pi@pi3:~ $ gcalcli agenda today tomorrow

Mon Oct 07 Reoccuring

Wed Oct 09 birthday 3:00pm testing caladd

Thu Oct 10
7:00am Wake

beardedfool avatar Oct 09 '19 02:10 beardedfool

Happy birthday! :)

Maybe adding --details=all would help shed some light on what is going on here. Also, can you report which version of gcalcli you're using?

jcrowgey avatar Oct 09 '19 17:10 jcrowgey

Thanks Joshua, hugely appreciated. sadly not my cake day ;) gcalcli v4.0.4

I looking at details all and realised that was an appointment from another calendar. But having made a new appointmentit still seems to happen

As I want to give you the full output, but would rather not post that here, mind if I email it to you?

Can I just check something obvious today= midnight this morning to midnight this evening right? tomorrow= midnight to midnight tomorrow, right?

beardedfool avatar Oct 09 '19 19:10 beardedfool

Ha, I wish that was more obvious than it is!

Here's a first test:

$ gcalcli agenda

No Events Found...
$ gcalcli add --when=tomorrow 
Title: test
Location: anywhere
Duration (minutes): 40
Description: a test
Enter a valid reminder or "." to end: .
0 [email protected]
Specify calendar from above: 0
$ gcalcli agenda

Wed Oct 23  9:00am             test

So, at least in creating an event, 'tomorrow' seems to default to 9AM. Of course there's a whole bunch of variables which might be relevant: my locale (set to US/Los_Angeles), my google calendar settings.

So now to test agenda search:

$ gcalcli agenda

Wed Oct 23  9:00am             test
$ gcalcli add --when="tomorrow 12:01am"
Title: just after midnight
Location: anywhere
Duration (minutes): 10
Description: a test after midnight
Enter a valid reminder or "." to end: .
0 [email protected]
Specify calendar from above: 0
$ gcalcli agenda today tomorrow

Wed Oct 23  12:01am            just after midnight

^^^ so that's a little surprising.

Ok, so this should be interesting:

$ for i in $(seq -w 00 23); do gcalcli add --when="tomorrow ${i}:01" --description="just after $i" --duration=10  --title="just after $i" --where="test" --noprompt"; done
$ gcalcli agenda --military

Wed Oct 23  :01            just after midnight
            :01            just after 00
            1:01           just after 01
            2:01           just after 02
            3:01           just after 03
            4:01           just after 04
            5:01           just after 05
            6:01           just after 06
            7:01           just after 07
            8:01           just after 08
            9:00           test
            9:01           just after 09
            10:01          just after 10
            11:01          just after 11
            12:01          just after 12
            13:01          just after 13
            14:01          just after 14
            15:01          just after 15
            16:01          just after 16
            17:01          just after 17
            18:01          just after 18
            19:01          just after 19
            20:01          just after 20
            21:01          just after 21
            22:01          just after 22
            23:01          just after 23
$ gcalcli agenda --military today tomorrow

Wed Oct 23  :01            just after midnight
            :01            just after 00
            1:01           just after 01
            2:01           just after 02
            3:01           just after 03
            4:01           just after 04
            5:01           just after 05
            6:01           just after 06
            7:01           just after 07
            8:01           just after 08

So that seems like a bug to me. Maybe we're dealing with UTC here (since I'm in -7 and with some sort of off by one error?). In any case, I'll open a bug for now.

jcrowgey avatar Oct 23 '19 02:10 jcrowgey

Just to recreate some of that in the UK - with daylight savings in effect, in case it helps

pi@pi3:~ $ gcalcli add --when="tomorrow 12:01am" Title: just after midnight Location: anywhere Duration (minutes): 10 Description: a test after midnight Enter a valid reminder or "." to end: . pi@pi3:~ $ gcalcli agenda today tomorrow

Thu Oct 24 pay mariana £30 12:01am just after midnight 7:00am Wake 7:30am wake-ba

For the loop, was that an extra quote just after the --noprompt? I had to ctrl+c

pi@pi3:~ $ for i in $(seq -w 00 23); do gcalcli add --when="tomorrow ${i}:01" --description="just after $i" --duration=10 --title="just after $i" --where="test" --noprompt"; done

^C

Assuming I found the right one

pi@pi3:~ $ for i in $(seq -w 00 23); do gcalcli add --when="tomorrow ${i}:01" --description="just after $i" --duration=10 --title="just after $i" --where="test" --noprompt; done

Thu Oct 24 pay mariana £30 00:01 just after midnight 00:01 just after 00 01:01 just after 01 02:01 just after 02 03:01 just after 03 04:01 just after 04 05:01 just after 05 06:01 just after 06 07:00 Wake 07:01 just after 07 07:30 wake-ba 08:01 just after 08

image

beardedfool avatar Oct 23 '19 12:10 beardedfool