@@ -45,7 +45,16 @@ func parsePatchSchedule(patchSchedule PatchSchedule) string {
4545 table .SetAutoWrapText (false )
4646 table .SetHeader ([]string {"Monthly Patch Release" , "Cherry Pick Deadline" , "Target Date" })
4747 for _ , upcoming := range patchSchedule .UpcomingReleases {
48- table .Append ([]string {strings .TrimSpace (upcoming .Release ), strings .TrimSpace (upcoming .CherryPickDeadline ), strings .TrimSpace (upcoming .TargetDate )})
48+ targetDate , err := time .Parse (refDate , upcoming .TargetDate )
49+ if err != nil {
50+ logrus .Errorf ("Unable to parse upcoming target date %q: %v" , upcoming .TargetDate , err )
51+ continue
52+ }
53+ table .Append ([]string {
54+ targetDate .Format (refDateMonthly ),
55+ strings .TrimSpace (upcoming .CherryPickDeadline ),
56+ strings .TrimSpace (upcoming .TargetDate )},
57+ )
4958 }
5059 table .SetBorders (tablewriter.Border {Left : true , Top : false , Right : true , Bottom : false })
5160 table .SetCenterSeparator ("|" )
@@ -167,8 +176,12 @@ func processFile(fileName string, vars interface{}) string {
167176 return process (tmpl , vars )
168177}
169178
179+ const (
180+ refDate = "2006-01-02"
181+ refDateMonthly = "January 2006"
182+ )
183+
170184func updatePatchSchedule (refTime time.Time , schedule PatchSchedule , eolBranches EolBranches , filePath , eolFilePath string ) error {
171- const refDate = "2006-01-02"
172185
173186 removeSchedules := []int {}
174187 for i , sched := range schedule .Schedules {
@@ -270,7 +283,7 @@ func updatePatchSchedule(refTime time.Time, schedule PatchSchedule, eolBranches
270283 continue
271284 }
272285
273- logrus .Infof ("Using existing upcoming release for %s (%s)" , upcomingRelease . Release , upcomingRelease .TargetDate )
286+ logrus .Infof ("Using existing upcoming release for %s" , upcomingRelease .TargetDate )
274287 newUpcomingReleases = append (newUpcomingReleases , upcomingRelease )
275288 latestDate = upcomingTargetDate
276289 }
@@ -286,7 +299,7 @@ func updatePatchSchedule(refTime time.Time, schedule PatchSchedule, eolBranches
286299 nextCherryPickDeadline := time .Date (latestDate .Year (), latestDate .Month (), cherryPickDay , 0 , 0 , 0 , 0 , time .UTC )
287300 nextTargetDate := time .Date (latestDate .Year (), latestDate .Month (), targetDateDay , 0 , 0 , 0 , 0 , time .UTC )
288301
289- logrus .Infof ("Adding new upcoming release for %s" , nextTargetDate .Format ("January 2006" ))
302+ logrus .Infof ("Adding new upcoming release for %s" , nextTargetDate .Format (refDateMonthly ))
290303
291304 newUpcomingReleases = append (newUpcomingReleases , & PatchRelease {
292305 CherryPickDeadline : nextCherryPickDeadline .Format (refDate ),
0 commit comments