date-time →
clamp(
    min: date-time,
    max: date-time
) → date-time

Returns the value of an argument dateTime, unless it is before min (in which case it returns min), or after max (in which case it returns max).

Parameters

Name Type Required Description
min date-time Yes value returned in case the argument value is before than it
max date-time Yes value returned in case the argument value is after than it

Argument evaluation

  • min: Evaluated in the enclosing context to check the lower bound, then evaluated again if that bound is returned.
  • max: Evaluated in the enclosing context when the lower-bound check allows it, then evaluated again if the upper bound is returned.

Examples

#"2024-01-15 12:30:00" | clamp(#"2024-01-01 00:00:00", #"2024-01-31 00:00:00")  #"2024-01-15 12:30:00"

Kind: Function
Scope: temporal
Aliases: dateTime-to-clamp, dateTime-to-clip


This site uses Just the Docs, a documentation theme for Jekyll.