SHARE
TWEET

Untitled

a guest Nov 19th, 2019 102 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const postProcessClockValues = ([hour, minute, second]) => {
  2.     let new_hour, new_minute, new_second;
  3.     if(minute < 0 && hour > 0) {
  4.         new_minute = 59;
  5.     }
  6.     else {
  7.         new_minute = minute;
  8.     }
  9.     if(second < 0 && minute > 0) {
  10.         new_second = 59;
  11.     }
  12.     else {
  13.         new_second = second;
  14.     }
  15.     if(hour === -1) {
  16.         new_hour = 0;
  17.     }
  18.     else {
  19.         new_hour = hour;
  20.     }
  21.     let result = [new_hour, new_minute, new_second];
  22.     return result;
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top