Postingan lainnya
Kelas Premium!
Belajar bikin website dari nol sekarang
Gunakan kupon "lebihcepat" untuk diskon 25%!
Blok tanggal sebelum hari ini
Biar input type date tidak membolehkan select hari sebelum hari ini (kemarin dan kebelakangnya) itu gimana ya ?
0
2 Jawaban:
Coba ini gan:
var pilihHari = '2012-11-03';
if( (new Date().getTime() > new Date(pilihHari).getTime()))
{
//Tidak Boleh Select
} else {
//Boleh Select
}
source: [link]https://stackoverflow.com/questions/11170054/compare-dates-with-javascript [/link] https://stackoverflow.com/questions/338463/how-do-i-do-a-date-comparison-in-javascript https://www.c-sharpcorner.com/UploadFile/8911c4/how-to-compare-two-dates-using-javascript/
0
pake datepicker jquery? coba pake ini
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<link rel="stylesheet" href="/resources/demos/style.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script>
$( function() {
$( "#datepicker" ).datepicker(
{minDate: new Date(),}
);
} );
</script>
</head>
<body>
<form id="form" method="post">
<input type="text" name="tgl" id="datepicker">
</form>
</body>
</html>
0