use const

This commit is contained in:
2025-12-10 14:56:24 +09:00
parent dff6da46c9
commit f885690bd7

View File

@@ -94,7 +94,7 @@ func (*Flow) mergeWeathers(dateKey string, location *time.Location, weathers []*
filteredWeathers := make(map[string]*domain.Weather)
for _, weather := range weathers {
key := string(weather.Source()) + weather.TargetDate().Format("2006-01-02")
key := string(weather.Source()) + weather.TargetDate().Format(time.DateTime)
existing, ok := filteredWeathers[key]
if !ok {
@@ -151,7 +151,7 @@ func (*Flow) groupByDate(weathers []*domain.Weather, location *time.Location) ma
for _, weather := range weathers {
localDate := weather.TargetDate().In(location)
dateKey := time.Date(localDate.Year(), localDate.Month(), localDate.Day(), 0, 0, 0, 0, location).Format("2006-01-02")
dateKey := time.Date(localDate.Year(), localDate.Month(), localDate.Day(), 0, 0, 0, 0, location).Format(time.DateOnly)
weathersByDate[dateKey] = append(weathersByDate[dateKey], weather)
}