1 changed files with 47 additions and 0 deletions
@ -0,0 +1,47 @@ |
|||||||
|
<!DOCTYPE html> |
||||||
|
<html> |
||||||
|
<body> |
||||||
|
|
||||||
|
<h1>countdown slideshow</h1> |
||||||
|
|
||||||
|
<p>Config:</p> |
||||||
|
<!-- with input that accepts multiple files, notice the multiple attribute--> |
||||||
|
<input id="fileInput" type="file" multiple> |
||||||
|
<input id="datePicker" type="datetime-local" name="targetDate"> |
||||||
|
<input id="startButton" type="button" value="Start!"> |
||||||
|
|
||||||
|
<script> |
||||||
|
Date.prototype.addHours= function(h){ |
||||||
|
this.setHours(this.getHours()+h); |
||||||
|
return this; |
||||||
|
} |
||||||
|
|
||||||
|
//set current date |
||||||
|
document.getElementById('datePicker').defaultValue = (new Date).addHours(1).toISOString().slice(0,-5); |
||||||
|
|
||||||
|
document.getElementById("fileInput").onchange=function(){ |
||||||
|
//files = Array.from(document.getElementById("fileInput").files) |
||||||
|
//fl.forEach((file)=>{console.log(file.name)}) |
||||||
|
|
||||||
|
let files=Array.from(this.files); |
||||||
|
let names= files.map(file => file.name) |
||||||
|
document.getElementById("fileNames").innerText = "filenames:\n"+names.join("\n") |
||||||
|
console.log(names) |
||||||
|
|
||||||
|
}; |
||||||
|
|
||||||
|
|
||||||
|
document.getElementById("startButton").onclick=function(){ |
||||||
|
console.log("starting") |
||||||
|
let dateInput = document.getElementById("datePicker") |
||||||
|
console.log("date valid:"+dateInput.checkValidity()) |
||||||
|
console.log(dateInput.value) |
||||||
|
}; |
||||||
|
</script> |
||||||
|
|
||||||
|
<div id="fileNames"> |
||||||
|
</div> |
||||||
|
|
||||||
|
|
||||||
|
</body> |
||||||
|
</html> |
||||||
Loading…
Reference in new issue