clarkmcc / cel-rust

Common Expression Language interpreter written in Rust
https://crates.io/crates/cel-interpreter
MIT License
377 stars 21 forks source link

Support Timestamp type #4

Closed clarkmcc closed 1 year ago

clarkmcc commented 1 year ago
// Parses RFC3339 timestamps into a timestamp type
timestamp('2023-05-28T00:00:00Z')

// Comparison
timestamp('2023-05-29T00:00:00Z') > timestamp('2023-05-28T00:00:00Z') == true

// Subtracting durations
timestamp('2023-05-29T00:00:00Z') - duration('24h') == timestamp('2023-05-28T00:00:00Z')

// Subtracting dates
timestamp('2023-05-29T00:00:00Z') - timestamp('2023-05-28T00:00:00Z') == duration('24h')

// Adding durations
timestamp('2023-05-28T00:00:00Z') + duration('24h') == timestamp('2023-05-29T00:00:00Z')