Skip to content

Commit

Permalink
chore: fixed cycle import trouble.
Browse files Browse the repository at this point in the history
  • Loading branch information
Borislavv committed Apr 22, 2024
1 parent c8c074c commit 2b30577
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions internal/infrastructure/helper/time.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
package helper

import (
"github.com/Borislavv/video-streaming/internal/domain/errtype"
"errors"
"time"
)

var (
InvalidDateFormat = errors.New("invalid date format")
)

var dateLayouts = []string{
"2006-01-02T15:04:05Z07:00",
"2006-01-02T15:04:05",
Expand All @@ -23,5 +27,5 @@ func ParseTime(date string) (time.Time, error) {
}
return parsed, nil
}
return time.Time{}, errtype.NewTimeParsingValidationError(date)
return time.Time{}, InvalidDateFormat
}

0 comments on commit 2b30577

Please sign in to comment.