Skip to content

Introduce Catmandus less_than and greater_than conditionals  #650

Closed
@TobiasNx

Description

@TobiasNx

Introduce greater_than and less_than conditionals from Catmandu.
Requested by TU D for comparing numbers and years. This seems to be a good feature and already supported by catmandu.

from Catmandu:

# greater_than(X,Y) is true when X > Y
if greater_than('year','2018')
 add_field('my.funny.title','true')
end
# greater_than on arrays checks if all values are X > Y
if greater_than('years.*','2018')
  add_field('my.funny.title','true')
end

and

# less_than(X,Y) is true when X < Y
if less_than('year','2018')
 add_field('my.funny.title','true')
end
# less_than on arrays checks if all values are X < Y
if less_than('years.*','2018')
  add_field('my.funny.title','true')
end

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions