Get a date relative to any start date

With the Relative dates Pack you can take a date and convert it to the next Friday, the last Tuesday, the Thursday of the same week, or whatever your heart desires...


I’ve been asked a number of times how you can take a date in Coda and convert it to the date of the next Wednesday, Friday, or Monday, and so on. This conversion is especially useful when you’re setting deadlines, due dates, or even when you just want to know what date of the start of the week is, for example, seven weeks from now. It’s
, by the way.

While this is doable natively in Coda today, there are a couple points of friction:
The formula to find a relative date isn’t particularly easy to remember unless you do it often. Here’s an example of the formula:
To select the day of the week, you have to provide Coda an integer between 0 and 6. And I can never remember whether 0 is a Saturday, Sunday, or Monday, so I always have to check my work.

This process was always slower than I’d like, which is why when I got access to Coda’s Pack Studio, I knew I wanted to turn this formula into a user-friendly Pack.

As someone who has never programmed in my life, writing JavaScript inside of the Coda Pack Studio was intimidating at first.

But I realized pretty quickly that, since I already understood what I needed to do to transform the dates using Coda Formula Language, I just needed to translate that into JavaScript — which was actually pretty easy! Some strategic Google searches plus the great was all I needed to build what I think is a much more user-friendly way to find a relative date.

Check it out in the formulas on the pages below, and please let me know what you think and where the Pack can improve .

Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
) instead.