# endOfWeek() in CQL: syntax and examples for Confluence

URL: https://goingstellar.ro/reference/cql/endofweek/

endOfWeek() is the boundary that ends the current week. With a negative offset it names the end of a past week, so two calls give you any closed week for a weekly review: after the earlier end, up to the later one.

## Syntax

```
endOfWeek()
endOfWeek("inc")
```

## Arguments

- `inc` (optional: no): Optional offset in the form (+/-)nn(y|M|w|d|h|m): y year, M month, w week, d day, h hour, m minute. Quoted. With no sign, plus is assumed. The unit is required and case sensitive, and the offset moves the boundary.

## Works with

- Fields: created, lastmodified
- Operators: =, !=, >, >=, <, <=
- Not with: ~, !~, IN, NOT IN (checked on Confluence Cloud, November 2026: `created ~ endOfWeek()` is rejected)

## Examples

```
created > endOfWeek("-1w")
```

Content created after last week ended, which is this week so far. This is the documentation example. Run on Confluence Cloud on 2026-11-29.

```
lastmodified > endOfWeek("-1w") AND lastmodified <= endOfWeek()
```

Edits made this week, with a bound on both sides. Run on Confluence Cloud on 2026-11-29.

```
lastmodified > endOfWeek("-2w") AND lastmodified <= endOfWeek("-1w") AND type = page
```

Pages edited during last week, for a Monday review. Slide both offsets by one to get the week before. Run on Confluence Cloud on 2026-11-29.

```
type = comment AND created > endOfWeek("-1w")
```

Comments added this week, to see whether the review page got any feedback. Run on Confluence Cloud on 2026-11-29.

```
lastmodified <= endOfWeek() AND space = SD ORDER BY lastmodified DESC
```

Everything in a space edited up to the end of this week, most recent first. Run on Confluence Cloud on 2026-11-29.

## Pitfalls

- Weeks are counted the same way as in startOfWeek(). On the Confluence Cloud site checked in November 2026, `endOfWeek()` on a Sunday resolved to 00:00 on the next Monday, which is the same instant as the next `startOfWeek()`.
- Use a strict `>` on the lower bound and `<=` on the upper bound. Mixing it up with `>=` counts content at the exact boundary in two adjacent weeks.
- A positive offset is accepted, for example `endOfWeek("+1w")`, and gives the end of next week. It has little use on `created` and `lastmodified`, which cannot lie in the future.
- The value is built from text, so a typo only shows up at run time: `endOfWeek("-1s")` fails with HTTP 500 "IllegalArgumentException executing cql".

## Related

- [startOfWeek()](https://goingstellar.ro/reference/cql/startofweek/)
- [endOfDay()](https://goingstellar.ro/reference/cql/endofday/)
- [endOfMonth()](https://goingstellar.ro/reference/cql/endofmonth/)
- [created](https://goingstellar.ro/reference/cql/created-field/)
- [lastmodified](https://goingstellar.ro/reference/cql/lastmodified-field/)
- [now()](https://goingstellar.ro/reference/cql/now/)

## Sources

- [CQL functions (Atlassian Developer, Confluence Cloud)](https://developer.atlassian.com/cloud/confluence/cql-functions/)

