Skip to content

Commit

Permalink
time: add missing custom_format token (#18880)
Browse files Browse the repository at this point in the history
  • Loading branch information
ttytm committed Jul 17, 2023
1 parent c2dc1ca commit 63867d4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion vlib/time/custom_format_test.v
Expand Up @@ -5,7 +5,7 @@ fn test_custom_format() {
assert date.custom_format('YYYY-MM-DD HH:mm') == date.format()
assert date.custom_format('MMM') == date.smonth()

test_str := 'M MM MMM MMMM\nD DD DDD DDDD\nd dd ddd dddd\nYY YYYY a A\nH HH h hh k kk e\nm mm s ss Z ZZ ZZZ\nDo DDDo Q Qo QQ\nN NN w wo ww\nM/D/YYYY N-HH:mm:ss Qo?a'
test_str := 'M MM Mo MMM MMMM\nD DD DDD DDDD\nd dd ddd dddd\nYY YYYY a A\nH HH h hh k kk e\nm mm s ss Z ZZ ZZZ\nDo DDDo Q Qo QQ\nN NN w wo ww\nM/D/YYYY N-HH:mm:ss Qo?a'

println(date.custom_format(test_str))
}
4 changes: 2 additions & 2 deletions vlib/time/format.v
Expand Up @@ -85,8 +85,8 @@ fn ordinal_suffix(n int) string {
}

const (
tokens_2 = ['MM', 'DD', 'Do', 'YY', 'ss', 'kk', 'NN', 'mm', 'hh', 'HH', 'ZZ', 'dd', 'Qo', 'QQ',
'wo', 'ww']
tokens_2 = ['MM', 'Mo', 'DD', 'Do', 'YY', 'ss', 'kk', 'NN', 'mm', 'hh', 'HH', 'ZZ', 'dd', 'Qo',
'QQ', 'wo', 'ww']
tokens_3 = ['MMM', 'DDD', 'ZZZ', 'ddd']
tokens_4 = ['MMMM', 'DDDD', 'DDDo', 'dddd', 'YYYY']
)
Expand Down

0 comments on commit 63867d4

Please sign in to comment.