Localize ROUNDDATETIME(_, 'week') and add a 1st day of the week setting

Greetings.

I recently needed to round a datetime in such a way that it is set to the first day of the week for the given date. However, that kind of call is not localized yet as of today. E.g. if we have mydate that is set to 27th of June 2025, the following expression :

ROUNDDATETIME( mydate, 'week' )

… should return 23rd of June 2025 00:00:00 for a country where week starts on a Monday. Unfortunately, in Tulip, such a call will always compute to a Sunday and we currently have no setting to tell which day of the week is the first.

I suggest that a new setting is added for this and that this is taken into account for ROUNDDATETIME(_, 'week') calls.

Hi @fti

Thanks for the suggestion. It may be possible to do a per-instance configuration of what the first day of the week is, and then update the Expression to take that as an optional global parameter for the station.

We’ll keep an eye on this thread to count upvotes and see how commonly this kind of setting would be used across customers/partners before we productionalize.

To help with prioritization and upvotes, could you share a bit more about your use case? Were you creating a schedule, visualizing a dashboard, or doing something with order management in apps/automations?

Hi @OlgaStroilova.

I can’t precisely recall what my customer intended to do back then. All I remember is that it was related to a manufacturing scheduling app. I had the same issue with another customer where they wanted to schedule machine maintenance.