diff options
author | xuri <xuri.me@gmail.com> | 2022-09-03 20:16:35 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2022-09-03 20:16:35 +0800 |
commit | 00470c17d95cb0f70b57b6fb0092b6f873949cd1 (patch) | |
tree | 5fb6fe259f604800456e97b8c279d8223fdcb1a7 /numfmt.go | |
parent | 75ce2317286181e2c250c10206df892278d5b981 (diff) |
This closes #1338, fix apply AM/PM format issue
Diffstat (limited to 'numfmt.go')
-rw-r--r-- | numfmt.go | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -696,7 +696,7 @@ func (nf *numberFormat) dateTimesHandler(i int, token nfp.Token) { nextHours := nf.hoursNext(i) aps := strings.Split(nf.localAmPm(token.TValue), "/") nf.ap = aps[0] - if nextHours > 12 { + if nextHours >= 12 { nf.ap = aps[1] } } @@ -777,9 +777,11 @@ func (nf *numberFormat) hoursHandler(i int, token nfp.Token) { ap, ok := nf.apNext(i) if ok { nf.ap = ap[0] + if h >= 12 { + nf.ap = ap[1] + } if h > 12 { h -= 12 - nf.ap = ap[1] } } if nf.ap != "" && nf.hoursNext(i) == -1 && h > 12 { |