MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / BetweenStr

Function BetweenStr

eval/public/extension_func_registrar.cc:34–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32}
33
34CelValue BetweenStr(Arena* arena, absl::Time time_stamp,
35 absl::string_view start, absl::string_view stop) {
36 // convert start and stop into timestamps
37 absl::Time start_ts;
38 absl::Time stop_ts;
39 // check if timestamp parameter is between start and stop -> call BetweenTs
40 if (!absl::ParseTime(absl::RFC3339_full, start, &start_ts, nullptr) ||
41 !absl::ParseTime(absl::RFC3339_full, stop, &stop_ts, nullptr)) {
42 return CreateErrorValue(arena, "String to Timestamp conversion failed",
43 absl::StatusCode::kInvalidArgument);
44 }
45
46 return BetweenTs(arena, time_stamp, start_ts, stop_ts);
47}
48
49CelValue GetDateTz(Arena* arena, absl::Time time_stamp,
50 absl::TimeZone time_zone) {

Callers 1

Calls 2

CreateErrorValueFunction · 0.85
BetweenTsFunction · 0.85

Tested by

no test coverage detected