Skip to content

Instantly share code, notes, and snippets.

@Zax37
Created November 20, 2019 21:55
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Zax37/274df2a0920c5d37a3acc1209ac8802e to your computer and use it in GitHub Desktop.
Save Zax37/274df2a0920c5d37a3acc1209ac8802e to your computer and use it in GitHub Desktop.
Date: select first date
StartOfDateWeek: fromTimestamp(timestamp(prop("Date")) - (((day(prop("Date")) == 0) ? 7 : ((day(prop("Date")) - 1) * 24 + toNumber(formatDate(prop("Date"), "H")))) * 60 + toNumber(formatDate(prop("Date"), "m"))) * 60 * 1000)
WeeksFromOriginal: ceil(dateBetween(now(), prop("Date"), "days") / 7)
NearestDate: dateAdd(prop("Date"), prop("WeeksFromOriginal"), "weeks")
Whenever it's 24 hours from last event, NearestDate should update to same + 7 days.
@azedgetech
Copy link

Do you have any examples of how this is working for you? It's not adding 7 days on the NearestDate total for me.

@Zax37
Copy link
Author

Zax37 commented Nov 22, 2019

As I wrote above, NearestDate updates after 24 hours - that's my use case.

image

So here you can see, that in the first row NearestDate (last column) is 7 days from Date (middle column), because I had this lecture yesterday, but NearestDate in second column is same as Date, because I had this lecture today (24 hours didn't pass yet).

@azedgetech
Copy link

Gotcha. Makes sense. Great job on working through that, btw!

@Zax37
Copy link
Author

Zax37 commented Nov 22, 2019

Thanks! It would be quite simple to do if we had better date functions (like getting start of week for the date, which I had to implement myself), maybe Notion team will bring those one day :)

@azedgetech
Copy link

azedgetech commented Nov 22, 2019 via email

@azedgetech
Copy link

azedgetech commented Nov 22, 2019 via email

@alvaroybanez
Copy link

What I would love is to be able to embed or integrate Todoist, but nothing I've tried is working so far. But repetition and workflow are biggees. Thanks, Michael

________________________________ From: Michael Holt Sent: Friday, November 22, 2019 11:17 AM To: Zax37; Zax37 Cc: Comment Subject: Re: Zax37/Notion - Weekly Event I'm hoping! They've done a great job, to be sure. I'm looking forward to them building in the recurring functionality soon, but even without it, the more I discover, the more I see the potential and the more ideas come flooding in. Thanks, Michael
________________________________ From: Zachariasz Zacharski notifications@github.com Sent: Friday, November 22, 2019 10:53 AM To: Zax37 Cc: Michael Holt; Comment Subject: Re: Zax37/Notion - Weekly Event Thanks! It would be quite simple to do if we had better date functions (like getting start of week for the date, which I had to implement myself), maybe Notion team will bring those one day :) — You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://gist.github.com/274df2a0920c5d37a3acc1209ac8802e?email_source=notifications&email_token=AHV4ACWR547PMSC6YOO4EUTQVAMC5A5CNFSM4JQRPAA2YY3PNVWWK3TUL52HS4DFVNDWS43UINXW23LFNZ2KUY3PNVWWK3TUL5UWJTQAF4UMG#gistcomment-3090627, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AHV4ACUCAE7JY6BG3B5EJLDQVAMC5ANCNFSM4JQRPAAQ.

They are working on the API so I guess you could make it work as soon as the API comes out.

@azedgetech
Copy link

Well, to be honest, those are indeed biggees, so I've been doing that (repetition, workflows, etc.) in ClickUp with no trouble at all.

@alvaroybanez
Copy link

Well, to be honest, those are indeed biggees, so I've been doing that (repetition, workflows, etc.) in ClickUp with no trouble at all.

I actually found ClickUp to be pretty complex. But to each his own I guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment