Beginners Date Range Help :)

Hey All!

I have part of a solution but I am unsure if I’m on the right track and/or what to do with the operators for Date Range.

What I am trying to achieve is a job board that by default shows users all jobs that have a start date which fall during the current week. I also plan to add a date picker to allow them to specify dates.

I’ve created a workflow that grabs the current week’s start date and end date and creates a date range, but I’m stuck at the following:

  1. How do I have a repeating group with a “Current Week” that is updating on each week roll over?
  2. How do I use the Date Range information to set constraints for my repeating group?

Current Week Start Expression

Current Week End Expression

Workflow for Date Range
image

Result
image

Any Help?

It might be easier to use a Start Date and an End Date separately rather than using a date range type. This way, you could specify that Start Date < start of week and End Date > end of week to get this to work. :slight_smile:

1 Like

Thanks @eve :slight_smile: I thought so too but then got lost lol!

Our user wants to search the job by week - so if he/she selects a Start Date of June 23rd he/she wants to see all jobs in the week of June 21st - no end date is selected.

Using Start Week Date Rounded down to: week works great in grabbing the start of the week date. But where we run into issues is restricted our RG to only show jobs in that range of “the week of June 21st”

I’ve tried doing Start Date = Date/Time Picker’s Value and End Date = Date/Time Picker’s Value +7. But that always gives us a wider range we need since the Start Date can be a Monday + 7 or a Thursday + 7.

That’s why we leaned towards Date Range since it can give us a specific set of days - I can figure out how to store the data on the back end but don’t know how to use it as a search filter on our RG.

Start Date >= Date/Time Picker’s Value
End Date <= Date/Time Picker’s Value +7

:+1:

1 Like

Hey @rpetribu

Thanks for jumping in!

We tried this as well but the issue is that it goes beyond our date range of “The Current Week”.

We’re trying to limit the search to say: If today is the 18th - find us the start of the week using :rounddowntoweek. This gets us June 13th.

However the end date is going to be Start Date [June 18th] + 7 - and now our range has extended to June 24th - whereas we want to limit it to the week of June 18th which is a date range of June 13th + 7.

But I haven’t found a way to grab that data point and use it.

I’m able to display it on the UI but the RG won’t filter by it.

In the screenshot I have the Start Date selected as 6/16/2021 - and I am able to get the start of week (see the left side underneath the search - Calendar for the Week Text) shows us 6/13/2021.

Any ideas on how to now use that date of 6/13/2021 as our starting point for RG conditions?

@eve - I reread what you said and followed @rpetribu help as well.

I think we got part of it:) Thank you:)

I set the End Date to be the Start Date value rounded down to week + 7 Days.

That way it’s always 7 days from the start of the week!

1 Like

Hey!

As I understood, you want to pull all the jobs that start in the selected week.

You will have to pick the first and last day of the week based in the day selected by your user. This is easy and you already did it:

fist_day = Date/Time Picker’s Value:rounded down to week
last_day = Date/Time Picker’s Value:rounded down to week +(days): 6

Make your RG Search for Jobs that start in between theese dates:

Job’s Date >= fist_day
Job’s Date <= last_day

You can link your “Search for” to your Date Picker as well. So everytime you change the date, the RG will refresh the search…

Job’s Date >= Date/Time Picker’s Value:rounded down to week
Job’s Date <= Date/Time Picker’s Value:rounded down to week +(days): 6

Is it right?

@rpetribu correct. Although your way of describing it is much much better :slight_smile: Thank you for breaking it down.

I was wondering @rpetribu do you think it’s possible to do the following:

  1. Each job has a Start Date and an End Date.
    2 . The Start and End dates can extend more than 1 week.
  2. **Show Jobs that have “Job Start Dates” during the users selected week as well as “Job End Dates” that match the calendars [Start Week Date/End Week Dates]

Example:
Week 1 = June 13th - 19th. Week 2= June 20th - 26th -.
Job 1 has a Start Date of June 18th (falls into Week 1)
Job 1 has an End Date of June 22nd (falls into Week 2)
Job 1 is active during Week 1 and Week 2 and should be shown in both.

That way when the RG group refreshes based on the users selected week - user can see jobs that start OR end in that time frame.

I tried a Date Range for jobs (I’m starting to see those are hard to work with lol) - was hoping I could perform:
Job’s Date Range >= Date/Time Picker’s Value:rounded down to week
Job’s Date Range <= Date/Time Picker’s Value:rounded down to week +(days): 6

Any advice on what operator can be used for that?

Hey @rami.kaawach !

Glad to help! :facepunch:

Yes, you can!

So you need to Search for by the Jobs that already started and have not ended yet

Job’s Start Date <= Date/Time Picker’s Value:rounded down to week +(days): 6
Job’s Finish Date >= Date/Time Picker’s Value:rounded down to week

Job’s Start Date <= Date/Time Picker’s Value:rounded down to week +(days): 6

With this line you will pick all the jobs that started before the end of the selected week

Job’s Finish Date >= Date/Time Picker’s Value:rounded down to week

With this line you will pick all the jobs that have not ended yet, taking the start of the week as the measure parameter


With this filter, you will always pick the jobs that are still running in the selected week. It makes sense?

1 Like

Makes total sense! Thank you @rpetribu - greatly helpful!

This topic was automatically closed after 70 days. New replies are no longer allowed.