Advertisement
thesuhu

Javascript Date

Dec 7th, 2020
1,058
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # validasi range tanggal tanpa time
  2. var tglbuka = new Date('2020-12-08')
  3. tglbuka.setHours(0, 0, 0, 0)
  4. console.log(tglbuka)
  5. var tgltutup = new Date('2020-12-19')
  6. tgltutup.setHours(0, 0, 0, 0)
  7. console.log(tgltutup)
  8. var tglnow = new Date()
  9. tglnow.setHours(0, 0, 0, 0)
  10. console.log(tglnow)
  11. console.log(tglnow < tglbuka)
  12. console.log(tglnow > tgltutup)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement