Preview: test.php
Size: 1.23 KB
/home/justbyquicklly-old/justbyquicklly/www/test.php
<!DOCTYPE html><html lang="en"><head>
<meta >
<meta name="viewport" >
<title>jQuery UI Datepicker - Default functionality</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.24.0/moment.min.js"></script>
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<style>
input {
position: relative;
width: 150px; height: 20px;
color: white;
}
input:before {
position: absolute;
top: 3px; left: 3px;
content: attr(data-date);
display: inline-block;
color: black;
}
input::-webkit-datetime-edit, input::-webkit-inner-spin-button, input::-webkit-clear-button {
display: none;
}
input::-webkit-calendar-picker-indicator {
position: absolute;
top: 3px;
right: 0;
color: black;
opacity: 1;
}
</style>
</head>
<body>
<p>Date: <input type="date" data-date="" data-date-format="DD-MMM-YY" value="2024-07-04" min="2024-07-04" max="2024-07-30"></p>
<script>
$("input").on("change", function() {
this.setAttribute(
"data-date",
moment(this.value, "YYYY-MM-DD")
.format( this.getAttribute("data-date-format") )
)
}).trigger("change")
</script>
</body></html>
Directory Contents
Dirs: 12 × Files: 58