Skip to content

Commit

Permalink
updates from PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
j-lanson committed Sep 26, 2024
1 parent 197062a commit c8bda7b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions site/content/docs/guide/plugin/policy-expr.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ UTC by including `+{HH}:[MM]` or `-{HH}:[MM]`.
#### Span

Spans represent a duration of time using the `jiff` [crate] `Span` type. Policy
expression spans can include weeks, days, hours, minutes, and seconds (including
decimal fractions of a second). Spans are prefixed with the letter "P" followed
expression spans can include weeks, days, hours, minutes, and seconds. They can
include optional decimal fractions of the smallest unit of time (hours, minutes,
or seconds) used (e.g. `1.5h`). Spans are prefixed with the letter "P" followed
by optional date units. Time units are separated from date units with the letter
"T". All date and time units are specified in single case-agnostic letter
abbreviations after the number. For example, a span of one week, one day, one
Expand Down Expand Up @@ -97,9 +98,10 @@ following functions:
| `(lte <A> <B>)`| less than or equal | non-identifier primitives | evaluate `A <= B` |
| `(eq <A> <B>)` | equal | non-identifier primitives | evaluate `A == B` |
| `(neq <A> <B>)` | not equal | non-identifier primitives | evaluate `A != B` |
| `(add <A> <B>)` | add | integers, floats, bools, (datetime and span) | evaluate `A + B` |
| `(sub <A> <B>)` | subtract | integers, floats, bools, (datetime and span) | evaluate `A - B` |
| `(add <A> <B>)` | add | integers, floats, bools, spans, or (datetime + span) | evaluate `A + B` |
| `(sub <A> <B>)` | subtract | integers, floats, bools, spans, or (datetime + span) | evaluate `A - B` |
| `(divz <A> <B>)` | divide or zero | integers, floats | if `B == 0` return `B`, else evaluate `A / B` |
| `(duration <A> <B>)` | duration | datetimes | evaluate `A - B` to produce a `span` |
| `(and <A> <B>)` | and | bools | evaluate `A & B` |
| `(or <A> <B>)` | or | bools | evaluate `A | B` |
| `(not <A>)` | not | bool | evaluate `!A` |
Expand Down

0 comments on commit c8bda7b

Please sign in to comment.