|
|
|
@ -42,13 +42,16 @@ |
|
|
|
|
</select> |
|
|
|
|
</label> |
|
|
|
|
<script> |
|
|
|
|
// timezone offset in seconds |
|
|
|
|
const tzOffsetSec = new Date().getTimezoneOffset() * 60; |
|
|
|
|
const fileInput = document.getElementById('fileInput'); |
|
|
|
|
const fileDates = document.getElementById('fileDates'); |
|
|
|
|
fileInput.addEventListener('change', (e) => { |
|
|
|
|
const files = e.target.files; |
|
|
|
|
let dateMap = {}; |
|
|
|
|
for (let file of files) { |
|
|
|
|
dateMap[file.name] = file.lastModified / 1000; |
|
|
|
|
// convert from milliseconds to seconds and adjust for tz |
|
|
|
|
dateMap[file.name] = Math.round(file.lastModified / 1000) + tzOffsetSec; |
|
|
|
|
} |
|
|
|
|
fileDates.value = JSON.stringify(dateMap); |
|
|
|
|
}) |
|
|
|
|