Skip to content

Commit

Permalink
Merge pull request #97 from chenz4027/align-filter-format
Browse files Browse the repository at this point in the history
fix: add date format used by AWS for CreateTime on ASGs
  • Loading branch information
ekristen authored Feb 19, 2025
2 parents d67e9a8 + 5f60e06 commit ce326f3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/filter/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,8 @@ func parseDate(input string) (time.Time, error) {
formats := []string{"2006-01-02",
"2006/01/02",
"2006-01-02T15:04:05Z",
time.RFC3339Nano, // Format of t.MarshalText() and t.MarshalJSON()
"2006-01-02 15:04:05 -0700 MST", // Date format used by AWS for CreateTime on ASGs
time.RFC3339Nano, // Format of t.MarshalText() and t.MarshalJSON()
time.RFC3339,
}
for _, f := range formats {
Expand Down
2 changes: 2 additions & 0 deletions pkg/filter/filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ func TestFilter_UnmarshalFilter(t *testing.T) {
future.Format("2006-01-02"),
future.Format("2006/01/02"),
future.Format("2006-01-02T15:04:05Z"),
future.Format("2006-01-02 15:04:05.000 +0000 UTC"),
future.Format(time.RFC3339Nano),
future.Format(time.RFC3339),
},
Expand All @@ -422,6 +423,7 @@ func TestFilter_UnmarshalFilter(t *testing.T) {
past.Format("2006-01-02"),
past.Format("2006/01/02"),
past.Format("2006-01-02T15:04:05Z"),
past.Format("2006-01-02 15:04:05.14 -0700 MST"),
past.Format(time.RFC3339Nano),
past.Format(time.RFC3339),
},
Expand Down

0 comments on commit ce326f3

Please sign in to comment.