Guest User

Untitled

a guest
Jun 21st, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. if (value) {
  2. let splitTime = value.split(':')
  3. date = new Date()
  4. // If ...splitTime (spread operator) is used in below, compiler throws exeption - "Expected 1 or 4 arguments but got 0 or more" (I consider it as TS bug)
  5. date.setHours(splitTime[0], splitTime[1], splitTime[2]);
  6. // now I can use date string in my plugin
  7. }
Add Comment
Please, Sign In to add comment