fix(main): fix sorting of snapshots

This commit is contained in:
Yukine 2021-02-04 03:51:47 +01:00
parent c0851f94c0
commit 2e809fbc03
No known key found for this signature in database
GPG Key ID: 6AE0B5764F0126D1
1 changed files with 2 additions and 2 deletions

View File

@ -107,12 +107,12 @@ func main() {
if snapshotLength > snapshotCount {
sort.SliceStable(snapshots, func(firstIndex, secondIndex int) bool {
firstTime, err := time.Parse(snapshots[firstIndex].Created, createdAtFormat)
firstTime, err := time.Parse(createdAtFormat, snapshots[firstIndex].Created)
if err != nil {
handleError(ctx, err, true)
}
secondTime, err := time.Parse(snapshots[firstIndex].Created, createdAtFormat)
secondTime, err := time.Parse(createdAtFormat, snapshots[firstIndex].Created)
if err != nil {
handleError(ctx, err, true)
}