Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -314,12 +314,9 @@ examples:

- name: "Duration and timestamp"
expr: |
// Needs Expr translation from CEL. Contributions welcome!
// https://github.com/polds/expr-playground/issues/43
//
// Validate that 'expired' date is after a 'created' date plus a 'ttl' duration
has(object.expired) &&
timestamp(object.created) + duration(object.ttl) < timestamp(object.expired)
"expired" in object &&
date(object.created) + duration(object.ttl) < date(object.expired)
data: |
object:
created: "2023-06-14T02:00:14+00:00"
Expand Down