mirror of
https://github.com/psviderski/uncloud.git
synced 2026-10-08 14:14:52 +00:00
feat(logs): add support for days unit (d) in --since/until filters for logs
This commit is contained in:
1 parent
409dc3bfe3
commit
5e26cfbead
5 files changed
+145
-9
No files matched your search
@@ -28,7 +28,7 @@ func timestamp(value string, now time.Time) (string, error) {
|
||||
return "", nil
|
||||
}
|
||||
// A bare zero is the Unix epoch, matching Docker's log filters.
|
||||
if duration, err := time.ParseDuration(value); value != "0" && err == nil {
|
||||
if duration, err := ParseDuration(value); value != "0" && err == nil {
|
||||
return now.Add(-duration).UTC().Format(time.RFC3339Nano), nil
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user