diff --git a/internal/repository/holiday_repository.go b/internal/repository/holiday_repository.go index 1b4f596..de511a8 100644 --- a/internal/repository/holiday_repository.go +++ b/internal/repository/holiday_repository.go @@ -90,17 +90,17 @@ func (r *holidayRepository) GetAll(filter models.HolidayFilter) ([]models.Holida if filter.Year != nil { whereConditions = append(whereConditions, "strftime('%Y', date) = ?") - args = append(args, strconv.Itoa(*filter.Year)) + args = append(args, fmt.Sprintf("%d", *filter.Year)) } if filter.Month != nil { whereConditions = append(whereConditions, "strftime('%m', date) = ?") - args = append(args, strconv.Itoa(*filter.Month)) + args = append(args, fmt.Sprintf("%02d", *filter.Month)) } if filter.Day != nil { whereConditions = append(whereConditions, "strftime('%d', date) = ?") - args = append(args, strconv.Itoa(*filter.Day)) + args = append(args, fmt.Sprintf("%02d", *filter.Day)) } if filter.Type != nil { diff --git a/pkg/client/client.go b/pkg/client/client.go index 4119d28..1eaf023 100644 --- a/pkg/client/client.go +++ b/pkg/client/client.go @@ -6,7 +6,6 @@ import ( "encoding/json" "fmt" "net/http" - "strconv" "time" ) @@ -102,10 +101,10 @@ func (c *Client) GetHolidays(ctx context.Context, year, month *int, holidayType q := req.URL.Query() if year != nil { - q.Add("year", strconv.Itoa(*year)) + q.Add("year", fmt.Sprintf("%d", *year)) } if month != nil { - q.Add("month", strconv.Itoa(*month)) + q.Add("month", fmt.Sprintf("%d", *month)) } if holidayType != "" { q.Add("type", holidayType)