Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
InfiniteStash committed Oct 30, 2024
1 parent b7fdefd commit 6e8ee1f
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions pkg/scraper/stashbox/stash_box.go
Original file line number Diff line number Diff line change
Expand Up @@ -1357,12 +1357,17 @@ func (c *Client) submitDraft(ctx context.Context, query string, input interface{
}

func padFuzzyDate(date *string) *string {
if date == nil {
return nil
}

var paddedDate string
if len(*date) == 10 {
return date
} else if len(*date) == 7 {
switch len(*date) {
case 10:
paddedDate = *date
case 7:
paddedDate = fmt.Sprintf("%s-01", *date)
} else if len(*date) == 4 {
case 4:
paddedDate = fmt.Sprintf("%s-01-01", *date)
}
return &paddedDate
Expand Down

0 comments on commit 6e8ee1f

Please sign in to comment.