Skip to content

Commit

Permalink
Fix another issue with day of week names and updated UT
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Golus committed Dec 22, 2016
1 parent eba53a8 commit 282a458
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion strftime.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func Strftime(t *time.Time, format string) string {
continue
case 'w', 'u': // w sunday is 0,0..6 u monday is 1,1..7
wd := int(t.Weekday() - time.Sunday)
if wd == 0 && b[i] == 'u' {
if wd == 0 && b[i+1] == 'u' {
app(strconv.Itoa(7), &i, 1)
} else {
app(strconv.Itoa(wd), &i, 1)
Expand Down
4 changes: 2 additions & 2 deletions strftime_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ func TestFormat(t *testing.T) {
"%k": " 9",
"%I": "09",
"%l": " 9",
"%P": "am",
"%p": "AM",
"%P": "pm",
"%p": "PM",

// Minute
"%M": "37",
Expand Down

0 comments on commit 282a458

Please sign in to comment.