(time: Mutable<AnyTime>)
| 249 | } |
| 250 | |
| 251 | export function constrainTime(time: Mutable<AnyTime>): void { |
| 252 | time.millisecond = Math.max(0, Math.min(time.millisecond, 1000)); |
| 253 | time.second = Math.max(0, Math.min(time.second, 59)); |
| 254 | time.minute = Math.max(0, Math.min(time.minute, 59)); |
| 255 | time.hour = Math.max(0, Math.min(time.hour, 23)); |
| 256 | } |
| 257 | |
| 258 | function nonNegativeMod(a: number, b: number) { |
| 259 | let result = a % b; |
no outgoing calls
no test coverage detected