Skip to main content
Solved

Calculate "Week Commencing" - Not quite right...

  • December 23, 2022
  • 2 replies
  • 60 views

Forum|alt.badge.img+2

Hi guys,

We have a field that lists the publish date + time for a piece of web content. 

We want to be able to organise all of these dates into 'week commencing', ie. add a field that gives the date of the Monday of that week. So, an item published say on Thurs 22nd December 2022, falls into 'Week Commencing' 19th December 2022. Something published on Friday 23rd December 2022, also the same Week Commencing date. 

The formula we're using to do this is:

DATEADD({CONTENT PUBLISH DATE},1-WEEKDAY({CONTENT PUBLISH DATE}),'days')

And it sort of works. But it seems to want to force some content pieces from the end of the week into the next week and I'm unsure why. For example, I have a piece of content dated for the 11th December 2022, 3pm, yet it forces it into week commencing 12/12/2022. 

Any ideas why this might be?

Best answer by John_B2

First make sure all timezones are the same.

Second - try this

DATEADD({CONTENT PUBLISH DATE},0-WEEKDAY({CONTENT PUBLISH DATE},"Monday"),'d')
 

2 replies

Forum|alt.badge.img+9
  • Inspiring
  • Answer
  • December 23, 2022

First make sure all timezones are the same.

Second - try this

DATEADD({CONTENT PUBLISH DATE},0-WEEKDAY({CONTENT PUBLISH DATE},"Monday"),'d')
 

Forum|alt.badge.img+2
  • Author
  • New Participant
  • January 5, 2023

First make sure all timezones are the same.

Second - try this

DATEADD({CONTENT PUBLISH DATE},0-WEEKDAY({CONTENT PUBLISH DATE},"Monday"),'d')
 

You sir, are a star, thank you! Happy New Year!