问题描述
<input type="date" class="form-control date-picker" id="date2" name="date" data-date-format="DD MMMM YYYY" [min]="" ngModel required placeholder="dob">
我正在尝试在没有 Angular 库的情况下淡出未来的日期。
解决方法
尝试使用:
From: Pepé Le Pew <[email protected]>
To: Penelope Pussycat <[email protected]>,Fabrette Pussycat <[email protected]>
Subject: This email sent from Python code
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
CQlTYWx1dCEKCgkJQ2VsYSByZXNzZW1ibGUgw6AgdW4gZXhjZWxsZW50IHJlY2lwaWVbMV0gZMOp
amV1bmVyLgoKCQlbMV0gaHR0cDovL3d3dy55dW1tbHkuY29tL3JlY2lwZS9Sb2FzdGVkLUFzcGFy
YWd1cy1FcGljdXJpb3VzLTIwMzcxOAoKCQktLVBlcMOpCgkJCg==
const datepicker = document.getElementById('date');
const today = new Date();
let date = today.getDate() > 9 ? today.getDate() :
`0${today.getDate()}`;
let month = today.getMonth() > 9 ? today.getMonth() + 1 :
`0${today.getMonth() + 1}`;
let year = today.getFullYear();
datepicker.setAttribute('max',`${year}-${month}-${date}`);
console.log(datepicker);