()
| 56 | } |
| 57 | |
| 58 | function* TimeOfDayParser() { |
| 59 | let hours = yield ParseInt; |
| 60 | const minutes = yield optional(MinutesSuffixParser); |
| 61 | const amOrPm = yield optional('am', 'pm'); |
| 62 | if (amOrPm === 'pm' && hours <= 11) { |
| 63 | hours += 12; |
| 64 | } else if (amOrPm === 'am' && hours === 12) { |
| 65 | hours = 24; |
| 66 | } |
| 67 | return { hours, minutes }; |
| 68 | } |
| 69 | |
| 70 | function* TimespanSuffixParser() { |
| 71 | const started = yield optional('to', '-', '–', '—', 'until'); |
nothing calls this directly
no test coverage detected