Forum Academy Marketplace Showcase Pricing Features

New 1 Thing plugin - Day of Week | FREE

Ever wanted to dynamically get the date for this Sunday or next Wednesday without jumping through a host of ‘if current date: extract day’ conditionals?

Check out the 1 Thing - Day of Week plugin!

Exposes any day of the week as a date value. Place the element on the page and simply reference any of the element’s day variables to return the correct date.

Available day dates:

This Sunday
This Monday
This Tuesday
This Wednesday
This Thursday
This Friday
This Saturday

Want a custom interval with a dynamic start date? Use one or all of these options!

image

Available custom dates:
Custom Date 1
Custom Date 2
Custom Date 3
Custom Date 4

Just search Day of Week in the plugins page or search 1 Thing to see the other plugins in the 1 Thing collection.

Why 1 Thing? They all do just 1 Thing :slight_smile:

13 Likes

First off, let me thank you for providing such a useful plugin for free!

My question however, is regarding what “This Sunday” means. Every Sunday I need to send a link that gives my users access to a page displaying data from the previous week prior to that current Sunday.

My search constraint is set as Created Date > This Sunday -7 days. Is that the correct setup for what I’m trying to achieve?

Thanks again for your hard work!

@callidusxi, yes, this is based on your week starting on Sunday so This Sunday will be the Sunday of this week. So today is Thursday, May 7 so right now This Sunday would be May 3.

To get data created for the previous week you would set your search parameters to:

  • Created Date ≥ This Sunday - 7 days: round down to day
  • Created Date < This Sunday: round down to day

That will give you everything created on or after the previous Sunday at 00:00:00 and everything created before This Sunday at 00:00:00

Thanks! That’s exactly what I needed. Have a great weekend!

Hi Eli, I’m trying to get my head around whether I could use this for this use case:

A customer has to get their order in before every Wednesday at 5pm.

So if it’s Tuesday 19 May, the orders close date will be Wed 20 May at 5pm
But if it’s Friday 22 May, the orders close date will be 27 May at 5pm

Nb. I later want to display this as a countdown so the time would have to be a time, and not a text.

Hi, glad to see this plugin being used :slight_smile:

To answer your question, it should work perfectly. Whether it is Tuesday 19 May or Friday 22 May, the ‘This Wednesday’ state will have a date of Wednesday 20 May.

With this in mind you can set your condition around ‘This Wednesday’ like this:

When 'current date/time is ≤ This Wednesday round down to hour: change hour to 17' then the deadline is 'This Wednesday round down to hour: change hour to 17'

Otherwise the deadline is This Wednesday round down to hour: change hour to 17: + days 7'

Does that make sense?

1 Like

Hi Eli, thanks for your reply!

I looked at your example but I couldn’t get the ‘less than or equal sign’ after entering ‘current date/time’ which made me wonder if I was doing it in the right place.

As my businesses all have different closing days/times. I ended up doing the following for now until I work yours out.

Business has a number for their close day in the db and first interval is 7 days and second interval is 0 days:

Default text is ‘show closing date in 7 days time’ (I will also pull the business close hour from the db)

But if today’s day is the same as scheduled day and the current time of day is less than the business order close time then the interval is only 0.

This seems to be working so far.

I have a couple of questions if you have time to answer them:

1.The manual says that ‘rounded down to’ will ‘pull out the hour’ - does it mean that it does the same thing as ‘change minutes to 0’ in that it makes sure the hour is :00? Not sure what rounded down to is doing in your example.

  1. I’m going to use the countdown instructions elsewhere in this forum to point to the resulting order close date but it needs a date field to work from. Is there a way to pull out a real date/time type from my text field?

Yep, rounding down does the same thing as ‘change X to 0’ with the additional feature that it also rounds down all the trailing values as well.

For instance, say it is 17:34:23. If you ‘change minutes to 0’ your new value will be 17:00:23. However, when you use ‘round down by hour’ your new value will be 17:00:00.

Here’s a table that shows how the rounding down works on all the options

image

If you need a dynamic order close date, you are definitely correct in making the Start Day # based on a database value and having two custom dates with 0 and 7 as the intervals.

In the case here with the 0 interval set on Custom Date 2, Custom Date 2 becomes the same conditional point as This Wednesday above. Your condition could look like this:

image

@eli Thank you for making this plugin! However I can’t quite work out what I need to do in my use case.

Users join groups.
Each group sends a weekly reminder to all its members.
Each group needs to be able to specify the day of the week it wants its reminders to be sent. So in the group settings I can have either a dropdown with days of the week or a “select a start date” field.
Then when a new user joins the group, I want to schedule a future API workflow for the next reminder day for that group.

For example, a group sends its reminders every Thursday. If a user joins on a Tuesday I want it to schedule their first reminder for the Thursday 2 days later.

I’m sure this is simple but I can’t work out how to do it! Thanks in advance.

Hi @kball369,

The best way to do this on a per user basis is to use the custom dates. The start day can be dynamic so you would store the day number for the group that their notification are being sent on and make the Start Day # conditional to that date. Then set up Custom Date 1 with a value of 0 days (this is this week’s value) and Custom Date 2 with a value of 7 days (next week’s value). Like this:

Then use Custom Date 1 with a condition that says if Custom Date 1 < Current Date/Time then use Custom Date 2.

image

That should do what you need!

Side note and you may have considered this but I would recommend scheduling your workflow on the group itself. Each group would have a single API Workflow scheduled for the day of the week when their notifications should be sent out. When that workflow triggers it simply loops through all of the group’s users and sends a notification to each user. This would save the need to schedule a workflow for each new user that joins.

Thank you @eli, that’s perfect and it works exactly as you said.

The reason I’m not doing a single API workflow is because I wanted it to send the email at the same time but taking account the timezone of the user. So every user gets the email at 8am no matter where in the world they are. Would it still do that if I had a single API workflow for the whole group?

Maybe I just don’t get it. My weeks start on Mondays, but Sundays I get the next Monday as the Monday of my week:
Screenshot 2020-10-04 at 18.59.16

Thnx, Peter

hello I created a directory to reference several shops, I would like the stores to be able to add their opening and closing hours depending on the day (Monday, Tuesday, Wednesday …), and display an “open” icon when it is in the current date, I would like the same system as google.

Yes I am getting the same issue. Not sure if it is a bug or something to do with timezones. Peter what timezone are you based in? I am in GMT

Here are some screen shots to help with debug @eli

dayofweek5 dayofweek4 dayofweek2 dayofweek3

Hey @jof, the issue here is that the start date only affects the custom dates, not the ‘This day’ states.

Currently the ‘This day’ is based on a week start day of Sunday which is why you are seeing the behavior above. Let me look into reconfiguring this so it works properly with a Monday start date as well.

That would be awesome and much appreciated

Actually armed with that bit of info you just gave me I used a custom date with 0 and the start set to 1 so that gives me the current Monday, I think!

I tell a lie it still doesn’t work

I am using custom date 2 and it still gets the wrong Monday on a Sunday, when it reaches Sunday it shows the next day as the Monday rather than the previous Monday - even though start day is set to 1!

Hey @jof,

Just pushed an update with the ability to set the start day of the week to Monday. That should solve your issues.

Cheers!

1 Like