Browse Source

js update

andy 2 years ago
parent
commit
8ba2248f0f
2 changed files with 13 additions and 0 deletions
  1. BIN
      .DS_Store
  2. 13 0
      js/index.js

BIN
.DS_Store


+ 13 - 0
js/index.js

@@ -409,6 +409,19 @@ $.ajax({
     console.log('err', err);
   }
 });
+var date = new Date();
+var year = date.getFullYear();
+var month = ('0'+ (date.getMonth() + 1)).slice(-2);
+
+var day = ('0' + (date.getDate()+3)).slice(-2);
+// var day = date.getDay();
+console.log(date)
+console.log(date.getDate());
+console.log(date.getMonth())
+var time = year +'-'+ month +'-'+ day;
+console.log(time);
+document.getElementById('datepicker').value = time;
+document.getElementById('datepicker').setAttribute('min', time);
 
 // 手機板表單
 $.fn.serializeObject = function () {