fromDisplayHour
function fromDisplayHour(displayHour, dayPeriod): number;Rebuild a 0–23 hour from a displayed 1–12 hour and a day period.
The midnight/noon wrap is the part that is easy to get wrong: 12 AM is hour 0 and 12 PM is hour 12, so the 12 has to be folded to 0 before the period offset is added rather than after.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
displayHour | number |
dayPeriod | number |
Returns
Section titled “Returns”number