Skip to content
This repository was archived by the owner on Nov 7, 2025. It is now read-only.

Commit b4953ab

Browse files
authored
Another last minute fix (#1080)
Not sure if it's final, but that's where I end up today.
1 parent fefacc5 commit b4953ab

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

quesma/painful/model.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,16 @@ func (m *MethodCallExpr) Eval(env *Env) (any, error) {
199199

200200
return typeVal.Format(time.RFC3339), nil
201201

202+
case "formatISO8601NoTimezone":
203+
204+
typeVal, err := ExpectDate(val)
205+
206+
if err != nil {
207+
return nil, fmt.Errorf("%s: method '%s' failed to coerce '%v' into a datetime: %v ", m.Position, m.MethodName, val, err)
208+
}
209+
210+
return typeVal.Format("2006-01-02T15:04:05"), nil
211+
202212
default:
203213
return nil, fmt.Errorf("%s: '%s' method is not supported", m.Position, m.MethodName)
204214
}
@@ -252,7 +262,7 @@ func ExpectDate(potentialExpr any) (time.Time, error) {
252262
case string:
253263

254264
formats := []string{
255-
"Jan 2, 2006 @ 15:04:05.000 -0700 MST", // this format in example provided by Kibana\
265+
"Jan 2, 2006 @ 15:04:05.000 -0700 MST", // this format in example provided by Kibana
256266
"2006-01-02 15:04:05.000 -0700 MST", // clickhouse format
257267
"2006-01-02 15:04:05 -0700 MST", // early adopter format
258268
time.Layout,

0 commit comments

Comments
 (0)