Fixed sorting by date #1412

This commit is contained in:
Mike Farah
2022-11-04 12:21:12 +11:00
parent 7f5dda93c6
commit cf02b90624
11 changed files with 114 additions and 25 deletions
+9
View File
@@ -102,6 +102,15 @@ var subtractOperatorScenarios = []expressionScenario{
"D0, P[], (doc)::a: 2021-01-01T00:00:00Z\n",
},
},
{
description: "Date subtraction - only date",
skipDoc: true,
document: `a: 2021-01-01`,
expression: `.a -= "24h"`,
expected: []string{
"D0, P[], (doc)::a: 2020-12-31T00:00:00Z\n",
},
},
{
description: "Date subtraction - custom format",
subdescription: "Use with_dtf to specify your datetime format. See [date-time operators](https://mikefarah.gitbook.io/yq/operators/date-time-operators) for more information.",