Skip to content

Commit

Permalink
feat: Add locale (zh-tw) meridiem
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin82222 authored and Kevin Lin committed Dec 2, 2022
1 parent cbe91fd commit e65a326
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/locale/zh-tw.js
Expand Up @@ -42,6 +42,21 @@ const locale = {
MM: '%d 個月',
y: '1 年',
yy: '%d 年'
},
meridiem: (hour, minute) => {
const hm = (hour * 100) + minute
if (hm < 600) {
return '凌晨'
} else if (hm < 900) {
return '早上'
} else if (hm < 1100) {
return '上午'
} else if (hm < 1300) {
return '中午'
} else if (hm < 1800) {
return '下午'
}
return '晚上'
}
}

Expand Down

0 comments on commit e65a326

Please sign in to comment.