use unix timestamp for inv created & usedBy

usedBy is still stored as a string in invites.json to cope with existing
invites with times stored formatted. knz/strtime requires cgo for
strptime, so it has been replaced with the native itchyny/timefmt-go.
This commit is contained in:
Harvey Tindall
2021-04-06 21:25:44 +01:00
parent 6ec2186bdf
commit 3f8414c70a
9 changed files with 77 additions and 60 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
import { _get, _post, toggleLoader } from "../modules/common.js";
import { _get, _post, toggleLoader, toDateString } from "../modules/common.js";
import { Marked, Renderer } from "@ts-stack/markdown";
interface updateDTO {
@@ -29,7 +29,7 @@ export class Updater implements updater {
get date(): number { return Math.floor(this._date.getTime() / 1000); }
set date(unix: number) {
this._date = new Date(unix * 1000);
document.getElementById("update-date").textContent = this._date.toDateString() + " " + this._date.toLocaleTimeString();
document.getElementById("update-date").textContent = toDateString(this._date);
}
get description(): string { return this._update.description; }