gcalcli icon indicating copy to clipboard operation
gcalcli copied to clipboard

ENH/WIP: add a free command

Open jklymak opened this issue 5 years ago • 2 comments

This is not at all feature complete, but I was looking for a way to see when I am free during the working day. Here is a quick hack of that that I thought I would share fi anyone else was interested in taking it up.

% gcalcli free

Availability Apr 18 - Apr 26
----------------------------

Sat Apr 18 09:00 to 17:00

Sun Apr 19 09:00 to 12:00
           14:00 to 17:00

Mon Apr 20 09:00 to 10:30
           11:30 to 12:00
           13:00 to 13:30
           14:30 to 17:00

Tue Apr 21 09:00 to 12:00
           13:00 to 17:00

Wed Apr 22 09:00 to 12:30
           13:30 to 13:30
           14:30 to 14:30
           15:30 to 15:30
           16:30 to 17:00

Thu Apr 23 09:00 to 15:00
           16:00 to 17:00

jklymak avatar Apr 18 '20 22:04 jklymak

This looks really useful, thanks! I hope someone can push this over the finish line.

jcrowgey avatar Sep 13 '20 17:09 jcrowgey

@jcrowgey Thanks for the encouragement. I think it is close now, including timezone help. I invested a day doing this because a) I cannot find any other way to get free blocks, and b) I'm 9 h timezone away from most of my firm meetings so requests like "when can you meet 6 Dec to 16 Dec" were becoming onerous...

Now we have:

gcalcli --calendar='My Calendar' --calendar='Busy' free --timezone='US/Pacific' --daystart=07:00 --dayend=18:00 --mintime=30

to return free slots in my calendar 30 minute or longer, between 07:00 and 18:00 PST.

Availability Dec 05 - Dec 13
----------------------------
Timezone: PST
Sun Dec 05:
Mon Dec 06:
        07:00 to 08:30
Tue Dec 07:
        10:15 to 13:30
Wed Dec 08:
Thu Dec 09:
        07:00 to 08:15
Fri Dec 10:
        07:00 to 08:15
        12:00 to 13:30
Sat Dec 11:
        07:00 to 13:30
Sun Dec 12:
        07:00 to 13:30
Mon Dec 13:
        07:00 to 08:30

Needs tests, which I'm not finding easy to parse, so if anyone has suggestions for an example to follow...

jklymak avatar Dec 06 '21 09:12 jklymak