Guest User

Untitled

a guest
Jan 20th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width">
  6. <title>JS Bin</title>
  7. </head>
  8. <body>
  9.  
  10. <script id="jsbin-javascript">
  11. // Premier mai => 5 (numero du moi) / 1
  12. // noel => 12 /25
  13.  
  14. var nowMonth = new Date().getMonth();
  15. var nowDay = new Date().getDate();
  16.  
  17. console.log("le mois d'aujourdhui est " + nowMonth);
  18. console.log("le jour d'aujoudhui est " + nowDay);
  19.  
  20. var isChristmas = nowMonth == 11 && nowDay == 25;
  21. var isFirstMay = nowMonth == 4 && nowDay == 1;
  22.  
  23. if (isChristmas || isFirstMay){
  24. console.log("la boutique est fermée");
  25. } else {
  26. console.log("la boutique est ouverte");
  27. }
  28. </script>
  29.  
  30.  
  31.  
  32. <script id="jsbin-source-javascript" type="text/javascript">// Premier mai => 5 (numero du moi) / 1
  33. // noel => 12 /25
  34.  
  35. var nowMonth = new Date().getMonth();
  36. var nowDay = new Date().getDate();
  37.  
  38. console.log("le mois d'aujourdhui est " + nowMonth);
  39. console.log("le jour d'aujoudhui est " + nowDay);
  40.  
  41. var isChristmas = nowMonth == 11 && nowDay == 25;
  42. var isFirstMay = nowMonth == 4 && nowDay == 1;
  43.  
  44. if (isChristmas || isFirstMay){
  45. console.log("la boutique est fermée");
  46. } else {
  47. console.log("la boutique est ouverte");
  48. }
  49.  
  50. </script></body>
  51. </html>
Add Comment
Please, Sign In to add comment