Recently, I needed to run some date calculations in Liquid to detect what the start date (Sunday) or end date (Saturday) of the current week is, and I found there was no trivial filter in Power Pages’ Liquid for that.
But by doing some data manipulation, we can achieve that.
The basics
The date filter accepts Custom Date and Time Format strings as a parameter (same as in .net).
Looking at the documentation, we can see two options that can be used for handling the current weekday:

We can use either the “ddd” or “dddd” to detect what is the current weekday and do some logic on it.
The liquid code
Based on this option, I’ve put together the following Liquid code that:
- Based on the weekday, assign it to a variable telling what the weekday number is
- Based on the weekday number, calculate the offset until Sunday (so we can get today’s date and detect what date the current Sunday is).
- And based on Sunday’s date, detect what day is Saturday (assuming the week starts on Sunday)
The console.log statement is added only to help with debugging values, but use the variables as needed:
{% assign today_name = now | date: "dddd" %}
{% assign weekday_num = 0 %}
{% case today_name %}
{% when "Sunday" %}{% assign weekday_num = 0 %}
{% when "Monday" %}{% assign weekday_num = 1 %}
{% when "Tuesday" %}{% assign weekday_num = 2 %}
{% when "Wednesday" %}{% assign weekday_num = 3 %}
{% when "Thursday" %}{% assign weekday_num = 4 %}
{% when "Friday" %}{% assign weekday_num = 5 %}
{% when "Saturday" %}{% assign weekday_num = 6 %}
{% endcase %}
{%comment%} Move BACK to this week's Sunday{%endcomment%}
{% assign offsetToSunday = weekday_num | times: -1 %}
{% assign sunday = now | date_add_days: offsetToSunday %}
{%comment%} Saturday is 6 days after Sunday{%endcomment%}
{% assign saturday = sunday | date_add_days: 6 %}
<script>
console.log(`This Sunday: {{ sunday | date: "yyyy-MM-dd" }}`);
console.log(`This Saturday: {{ saturday | date: "yyyy-MM-dd" }}`);
</script>
Conclusion
Power Pages Liquid doesn’t have built-in filters to directly get the start or end of the week, but by using .NET-style date formats (ddd or dddd) to find the current weekday and mapping it to a number, we can calculate the offset to Sunday and Saturday easily.
Hope this post helps in case you come across similar need.
References