# Fun with Dates

**URL:** <https://community.glideapps.com/t/fun-with-dates/21684>\
**Category:** Project Showcase\
**Created:** [January 24, 2021, 8:25pm UTC](https://community.glideapps.com/t/fun-with-dates/21684 "2021-01-24T20:25:08Z")\
**Posts on this page:** 17\
**Page:** 8

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [June 12, 2021, 3:51am UTC](https://community.glideapps.com/t/fun-with-dates/21684/143 "2021-06-12T03:51:42Z")

</div>

Cheers! Would also be helpful if you want to do a feature like “This day last month” 😅

---

<div class="post-metadata">

**Author:** ![ehdubya](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ehdubya/32/24087_2.png) [@ehdubya](https://community.glideapps.com/u/ehdubya)\
**Post date:** [June 12, 2021, 6:09pm UTC](https://community.glideapps.com/t/fun-with-dates/21684/144 "2021-06-12T18:09:55Z")

</div>

Hey @Jeff_Hager , @ThinhDinh or @Darren_Murphy - do any of you know how you’d calculate “week of”?

For example, the ideal display would look like this:

“Week of: June 14, 2021 - June 20, 2021”

Thanks for any and all help!

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [June 12, 2021, 6:17pm UTC](https://community.glideapps.com/t/fun-with-dates/21684/145 "2021-06-12T18:17:01Z")

</div>

I would think you could do the same thing @ThinhDinh did here, but change the formatting of the date math columns and add ‘Week of’ to the template.

> [@Fun with Dates](https://community.glideapps.com/t/fun-with-dates/21684/123):
>
> I hope people would find this useful, I had a use case that needs users to submit a form once per week. Showing the week number to the admin might not be the most informative, so I used these to derive the start date and end date of each week (Monday and Sunday). Start date: Idea was moving everything to the current Sunday, then move back 6 days. End date: Same as above, but just move everything to the currrent Sunday. Weekday column was a simple weekday formula in a math…

---

<div class="post-metadata">

**Author:** ![ehdubya](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ehdubya/32/24087_2.png) [@ehdubya](https://community.glideapps.com/u/ehdubya)\
**Post date:** [June 12, 2021, 8:21pm UTC](https://community.glideapps.com/t/fun-with-dates/21684/146 "2021-06-12T20:21:01Z")

</div>

Will try this out - thanks! Also - thanks too ThinhDinh!

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [August 27, 2021, 6:48am UTC](https://community.glideapps.com/t/fun-with-dates/21684/147 "2021-08-27T06:48:10Z")

</div>

@Jeff_Hager or @ThinhDinh - having a mental block here…

I’m using the following to get midnight on the first day of the current month:

```auto
N+1-DAY(N)-HOUR(N)/24-MINUTE(N)/1440-SECOND(N)/86400

```

Which works fine, but what I need now is:

- Midnight on the first day of last month
- Midnight on the first day of 2 months ago
- Midnight on the first day of 3 months ago

Example: today is 27th August, I want 3 math columns that will return midnight on the 1st of May, June & July respectively. I’m thinking that the [magic number 15](https://community.glideapps.com/t/find-the-last-day-of-the-following-month/21557/7) needs to come into play here, but struggling with it…

Help? 🙏

(I know I could do this easily enough with a bit of YC, but prefer not to resort to that unless there is no other option)

---

<div class="post-metadata">

**Author:** ![Manu.n](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/manu.n/32/11679_2.png) [@Manu.n](https://community.glideapps.com/u/Manu.n)\
**Post date:** [August 27, 2021, 9:44am UTC](https://community.glideapps.com/t/fun-with-dates/21684/148 "2021-08-27T09:44:06Z")

</div>

I have finished 😜 😜 🤣 😂 😃 😀

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/a/5/a5141534c55d2fa9e9c6c8528cd049d39b45a3d7.png)

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [August 27, 2021, 9:45am UTC](https://community.glideapps.com/t/fun-with-dates/21684/149 "2021-08-27T09:45:32Z")

</div>

Hi Darren.

I believe this will work.

```auto
X-DAY(X-DAY(X))

```

With X referencing the column just before’s timestamp.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/c/2/c28d34eb68f2e18fb89be2041c1ad0451ed86b0e.png)

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/3/438488118f36b1b846891668d5292f61f915f433.png)

I tested with some timestamps instead of Now just to make sure.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/e/0e6828accdd8c43c857148cf0fa69904ae84d910.png)

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [August 27, 2021, 9:52am UTC](https://community.glideapps.com/t/fun-with-dates/21684/150 "2021-08-27T09:52:28Z")

</div>

haha 😂

I could have also done it that way, but that’s not what I wanted 😛

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [August 27, 2021, 9:53am UTC](https://community.glideapps.com/t/fun-with-dates/21684/151 "2021-08-27T09:53:00Z")

</div>

Wonderful, thank you! 👍

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [March 29, 2022, 6:55pm UTC](https://community.glideapps.com/t/fun-with-dates/21684/152 "2022-03-29T18:55:50Z")

</div>

> [@Jeff\_Hager](#):
>
> or some other use cases.

Resurrecting this awesome thread. Found myself using this functionality a few times this past week. Here’s a way to switch between “today” and “last month” by writing the text value of `last month` to a date column. The date column then acts as filter to display the correct leaderboard:

![CleanShot 2022-03-29 at 14.53.36](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/1/b131b94cb52a5f040e773e68e61bbc4a1f172764.gif)

@Jeff_Hager genius.

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [March 29, 2022, 8:16pm UTC](https://community.glideapps.com/t/fun-with-dates/21684/153 "2022-03-29T20:16:59Z")

</div>

@Robert_Petitto Brilliant!

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [March 30, 2022, 12:12am UTC](https://community.glideapps.com/t/fun-with-dates/21684/154 "2022-03-30T00:12:43Z")

</div>

Thansk for sharing! I’m surprised it works with set columns.

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [March 30, 2022, 2:31am UTC](https://community.glideapps.com/t/fun-with-dates/21684/155 "2022-03-30T02:31:30Z")

</div>

It’s actually a choice component that’s writing that value, but ya, sure does!

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [April 1, 2022, 5:19am UTC](https://community.glideapps.com/t/fun-with-dates/21684/156 "2022-04-01T05:19:13Z")

</div>

# Infinite calendar using only 32 rows!

Uses increment \> conditional template \> set column action.

![CleanShot 2022-04-01 at 01.17.10](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/d/0dc046c071f58fc6439bae6038bdf3e707b69277.gif)

---

<div class="post-metadata">

**Author:** ![rickc](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rickc/32/25824_2.png) [@rickc](https://community.glideapps.com/u/rickc)\
**Post date:** [April 18, 2022, 3:18pm UTC](https://community.glideapps.com/t/fun-with-dates/21684/157 "2022-04-18T15:18:51Z")

</div>

@Robert_Petitto I was going to post this in your other thread about creating a membership app but since you mention it here - I have found that the payhere api doesn’t always update the “next\_charge\_at” field. According to the api docs it only updates that field during subscription creation or cancelation, but not for recurring payments. Have you found this to be different? I just set up a test subscription that renews daily to fully test this.

Here are the payment success fields that are passed through: [Webhooks · Developers](https://developers.payhere.co/docs/webhooks#paymentsuccess)

Here is an example of it not passing the next\_charge\_at field:

 ![Screen Shot 2022-04-18 at 10.37.38 AM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/2/e/2ec537581c007a31edfa0a31ed34649d8406af13.png)

Reading this thread because my new thought is to set a next payment field myself by adding a month or year to the last payment date if the subscription is still active.

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [April 19, 2022, 12:08am UTC](https://community.glideapps.com/t/fun-with-dates/21684/158 "2022-04-19T00:08:22Z")

</div>

> [@rickc](#):
>
> I have found that the payhere api doesn’t always update the “next\_charge\_at” field.

> [@rickc](#):
>
> Reading this thread because my new thought is to set a next payment field myself by adding a month or year to the last payment date if the subscription is still active.

I can confirm this happened to me as well. From that point I have always used math columns to calculate it myself.

---

<div class="post-metadata">

**Author:** ![rickc](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rickc/32/25824_2.png) [@rickc](https://community.glideapps.com/u/rickc)\
**Post date:** [April 19, 2022, 1:54am UTC](https://community.glideapps.com/t/fun-with-dates/21684/159 "2022-04-19T01:54:04Z")

</div>

> [@ThinhDinh](#):
>
> I can confirm this happened to me as well. From that point I have always used math columns to calculate it myself.

Thanks for confirming! I realized I could easily do it with the addMonths argument in the make/integromat scenario too. I’ll post an update to that thread once I have it set.

[Previous page](https://community.glideapps.com/t/fun-with-dates/21684.md?page=7)
