Advertisement
uwong15

Untitled

May 22nd, 2022
840
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var input = [1]
  2. // result
  3. [{
  4.     start: 'monday',
  5.     end: 'monday'
  6. }]
  7.  
  8. var input = [1,2,3,4,5,6,7]
  9. // result
  10. [{
  11.     start: 'monday',
  12.     end: 'sunday'
  13. }]
  14.  
  15. var input = [1,2,3,5,6,7]
  16. //result
  17. [{
  18.     start: 'monday',
  19.     end 'wednesday'
  20. },
  21. {
  22.     start: 'friday',
  23.     end: 'sunday'
  24. }]
  25.  
  26. var input = [1,2,4,6,7]    
  27. // result
  28. [{
  29.     start: 'monday',
  30.     end 'tuesday'
  31. },
  32. {
  33.     start: 'thursday',
  34.     end: 'thursday'
  35. },
  36. {
  37.     start: 'saturday',
  38.     end: 'sunday'
  39. }]
Advertisement
RAW Paste Data Copied
Advertisement