Merge pull request #241 from writeas/post-time-fix

fixes imported post times
pull/210/head
Matt Baer 5 years ago committed by GitHub
commit 6d3803bfe8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      templates/user/import.tmpl

@ -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);
})

Loading…
Cancel
Save