(ts, tz ref.Val)
| 968 | } |
| 969 | |
| 970 | func timestampGetMonth(ts, tz ref.Val) ref.Val { |
| 971 | t, err := inTimeZone(ts, tz) |
| 972 | if err != nil { |
| 973 | return types.NewErrFromString(err.Error()) |
| 974 | } |
| 975 | // CEL spec indicates that the month should be 0-based, but the Time value |
| 976 | // for Month() is 1-based. |
| 977 | return types.Int(t.Month() - 1) |
| 978 | } |
| 979 | |
| 980 | func timestampGetDayOfYear(ts, tz ref.Val) ref.Val { |
| 981 | t, err := inTimeZone(ts, tz) |
no test coverage detected