Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function timePlusFiftheen([hours, minutes]) {
- hours = Number(hours);
- minutes = Number(minutes);
- let minsPlusFiftheen = minutes + 15;
- minsPlusFiftheen = '0' + (minsPlusFiftheen % 60);
- minsPlusFiftheen = minsPlusFiftheen.slice(-2);
- let hs = hours;
- if (minsPlusFiftheen > 59) {
- let hs = hs + 1;
- minsPlusFiftheen = minsPlusFiftheen - 60;
- } else if (hs == 24) {
- hours = 0;
- hs = 0;
- } else if (hours > 23) {
- hours = 0;
- }
- console.log(`${hs}:${minsPlusFiftheen}`);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement