mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-07 02:48:27 +08:00
Fixed sorting by date #1412
This commit is contained in:
@@ -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.",
|
||||
|
||||
Reference in New Issue
Block a user