How to use Text to set weekdays | Is not working as expected

Yes, I believe it will choose the nearest date if you don’t specify NEXT, THIS, etc. This is more of a pleasant side effect of java than it is an actual feature. In reality, it’s trying to guess the date that you meant, but how you interpret it and how the code interests it might be different.

A lot of it is largely discussed in this thread.

In your case, it maybe interpreting NEXT as Next week. In this case the nearest Monday and the Monday next week is actually the same, whereas Friday and Saturday still occur within this week.

I think you would be better off determining the date mathematically instead of letting glide interpret what it thinks the date should be.

Something like this might work in a Math column to determine Friday’s date of the current week.
now+6-WEEKDAY(now)

Something like this might work to get Friday of next week.
now+6-WEEKDAY(now)+7

For Saturday, you would replace 6 with 7.
For Monday, you would replace 6 with 2.

“Now” is assuming you want to use the current date in the formula. Instead you could use your start or end date as the replacement for Now.

It may not be the correct formula for your use case. I’m just doing this in my head, but hopefully you get the idea of how to mathematically calculate the dates. At least play with it and see if it gets you the dates you want. If not, I can sit down and work out some formulas.

3 Likes