Guest User

Untitled

a guest
Feb 17th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.83 KB | None | 0 0
  1. var a="24/05/2013";
  2. var b="26/05/2013";
  3.  
  4. function dateCheck() {
  5. var fDate = new Date("24/05/2013");
  6. var lDate; = new Date("26/05/2013");
  7. fDate = Date.parse(document.getElementById("fDate").value);
  8. lDate = Date.parse(document.getElementById("lDate").value);
  9.  
  10. if(fDate <= lDate) {
  11. alert("true");
  12. return true;
  13. }
  14. alert("false");
  15. return false;
  16. }
  17.  
  18. function dateCheck() {
  19. var a = new Date("24/05/2013");
  20. var b = new Date("26/05/2013");
  21. var checkinDate = Date.parse(document.getElementById("checkinDate").value);
  22. var checkoutDate = Date.parse(document.getElementById("checkoutDate").value);
  23.  
  24. return((checkinDate >= a && checkinDate <= b) &&
  25. (checkoutDate <= b && checkoutDate >= a) &&
  26. (checkoutDate > checkinDate))
  27. }
  28.  
  29. function dateCheck() {
  30. var a = new Date("24/05/2013");
  31. var b = new Date("26/05/2013");
  32. var checkinDate = Date.parse(document.getElementById("checkinDate").value);
  33. var checkoutDate = Date.parse(document.getElementById("checkoutDate").value);
  34.  
  35. return(( a > checkinDate && a < checkoutDate) &&
  36. (b < checkoutDate && b > checkinDate) &&
  37. (checkoutDate > checkinDate))
  38. }
  39.  
  40. var fdt= new Date("20/02/2013");
  41. var tdt = new Date("10/05/2013");
  42.  
  43. function validateFromAndToDate(fdt,tdt){
  44.  
  45. var dt1 = dte1.value.substring(0,2);
  46. var mon1 = dte1.value.substring(3,5);
  47. var yr1 =dte1.value.substring(6,10);
  48.  
  49. var dt2 = dte2.value.substring(0,2);
  50. var mon2 = dte2.value.substring(3,5);
  51. var yr2 = dte2.value.substring(6,10);
  52. var date1 = new Date(yr1, mon1-1, dt1);
  53. var date2 = new Date(yr2, mon2-1, dt2);
  54.  
  55. if (date2<date1){
  56. alert("Date period must be within the given date!");
  57. return false
  58. }
  59. return true
  60. }
Add Comment
Please, Sign In to add comment