mirror of
https://framagit.org/les/gancio.git
synced 2025-01-31 16:42:22 +01:00
12 hour clock selection, fix #119
This commit is contained in:
parent
e2227010f5
commit
e18b56447a
1 changed files with 4 additions and 4 deletions
|
@ -98,11 +98,11 @@ export default {
|
|||
},
|
||||
hourList () {
|
||||
const hourList = []
|
||||
const pad = '00'
|
||||
const leftPad = h => ('00' + h).slice(-2)
|
||||
for (let h = 0; h < 24; h++) {
|
||||
const paddedHour = (pad + h).slice(-2)
|
||||
hourList.push({ text: paddedHour + ':00 ' + (h <= 12 ? 'AM' : 'PM'), value: paddedHour + ':00' })
|
||||
hourList.push({ text: paddedHour + ':30 ' + (h <= 12 ? 'AM' : 'PM'), value: paddedHour + ':30' })
|
||||
const textHour = leftPad(h < 13 ? h : h - 12)
|
||||
hourList.push({ text: textHour + ':00 ' + (h <= 12 ? 'AM' : 'PM'), value: leftPad(h) + ':00' })
|
||||
hourList.push({ text: textHour + ':30 ' + (h <= 12 ? 'AM' : 'PM'), value: leftPad(h) + ':30' })
|
||||
}
|
||||
|
||||
return hourList
|
||||
|
|
Loading…
Reference in a new issue