Skip to content

Commit

Permalink
Update year formatting in output to use YYYY-YY format
Browse files Browse the repository at this point in the history
chrisreddington authored Dec 28, 2024
1 parent bdd428f commit 226902c
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
@@ -124,7 +124,8 @@ func formatYearRange(startYear, endYear int) string {
if startYear == endYear {
return fmt.Sprintf("%d", startYear)
}
return fmt.Sprintf("%02d-%02d", startYear%100, endYear%100)
// Use YYYY-YY format for multi-year ranges
return fmt.Sprintf("%04d-%02d", startYear, endYear%100)
}

// generateOutputFilename creates a consistent filename for the STL output
4 changes: 2 additions & 2 deletions main_test.go
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@ func TestFormatYearRange(t *testing.T) {
name: "different years",
startYear: 2020,
endYear: 2024,
want: "20-24",
want: "2020-24",
},
}

@@ -73,7 +73,7 @@ func TestGenerateOutputFilename(t *testing.T) {
user: "testuser",
startYear: 2020,
endYear: 2024,
want: "testuser-20-24-github-skyline.stl",
want: "testuser-2020-24-github-skyline.stl",
},
}

0 comments on commit 226902c

Please sign in to comment.