Need Help: Calendar That Identifies Weekends in Glide

Dear Glide Community,

I’m trying to add a calendar to my app that automatically recognizes weekends. Is there a simple way to achieve this? :folded_hands:

Can you elaborate a little on your actual goal please?

It’s easy enough to determine if any given date falls on a weekend, but what will you do with that information?

For example:

  • do you want weekends to appear differently on your calendar?
  • do you want to block users from creating events that fall on weekends?
  • something else?
1 Like

Dear Darren, thank you so much for responding.

I want to create special offers for weekends. So when a user selects a date that falls on a weekend, I’d like a weekend offer to automatically appear.

Okay, understood.

You will need to use a Custom Form for this, so that you can detect that a weekend day has been selected and apply the offer before the form is submitted. Have a look at the thread that I linked to, and you can download a template that demonstrates how to create a custom form.

When a date is selected, to detect whether or not it falls on a weekend, you simply need to pass the date to a Math column that uses the following formula:

Weekday(Date)

The above will return a number between 1 and 7, where 1 is a Sunday and 7 is a Saturday. So assuming that you define a weekend as Saturday/Sunday, then if the math column returns 1 or 7 then you know the selected date falls on a weekend.

3 Likes

Thank you so much! will try now :slight_smile: