1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

checker: check duplicate of a const name (#8396)

This commit is contained in:
yuyi
2021-01-29 01:34:55 +08:00
committed by GitHub
parent 684d2e6dbf
commit 1be7cc14d3
6 changed files with 40 additions and 27 deletions

View File

@ -93,7 +93,7 @@ pub fn (t Time) get_fmt_time_str(fmt_time FormatTime) string {
return ''
}
tp := if t.hour > 11 { 'p.m.' } else { 'a.m.' }
hour := if t.hour > 12 {
hour_ := if t.hour > 12 {
t.hour - 12
} else if t.hour == 0 {
12
@ -101,9 +101,9 @@ pub fn (t Time) get_fmt_time_str(fmt_time FormatTime) string {
t.hour
}
return match fmt_time {
.hhmm12 { '$hour:${t.minute:02d} $tp' }
.hhmm12 { '$hour_:${t.minute:02d} $tp' }
.hhmm24 { '${t.hour:02d}:${t.minute:02d}' }
.hhmmss12 { '$hour:${t.minute:02d}:${t.second:02d} $tp' }
.hhmmss12 { '$hour_:${t.minute:02d}:${t.second:02d} $tp' }
.hhmmss24 { '${t.hour:02d}:${t.minute:02d}:${t.second:02d}' }
.hhmmss24_milli { '${t.hour:02d}:${t.minute:02d}:${t.second:02d}.${(t.microsecond / 1000):03d}' }
.hhmmss24_micro { '${t.hour:02d}:${t.minute:02d}:${t.second:02d}.${t.microsecond:06d}' }