actually fix dates (wow)

This commit is contained in:
slonkazoid 2024-12-30 15:13:43 +03:00
parent a2d55b6055
commit aa2e2e92df
Signed by: slonk
SSH key fingerprint: SHA256:tbZfJX4IOvZ0LGWOWu5Ijo8jfMPi78TU7x1VoEeCIjM
2 changed files with 3 additions and 3 deletions

View file

@ -113,7 +113,7 @@ case "$action" in
db_query "SET TIME ZONE 'UTC'; INSERT INTO posts (username, contents, ts) VALUES (
$(escape_sql_str "$user"),
$(escape_sql_str "$status"),
$(escape_sql_str "$(date --rfc-3339=seconds)")::timestamp
$(escape_sql_str "$(date -u --rfc-3339=seconds)")::timestamp
) ON CONFLICT (username) DO UPDATE
SET contents=excluded.contents, ts=excluded.ts" >&2
echo '{"error":false}'

View file

@ -181,7 +181,7 @@ function renderStatus(status) {
instance.target = "_blank";
let timestamp = document.createElement("span");
timestamp.classList.add("timestamp", "date", "date-rfc3339");
timestamp.innerText = new Date(status.timestamp).toISOString();
timestamp.innerText = new Date(Date.UTC(status.timestamp)).toISOString();
meta.append(username, at, instance, " at ", timestamp);
quote.appendChild(meta);
@ -207,7 +207,7 @@ async function updateStatuses() {
for (let [contents, username, timestamp] of value)
statuses.push({
username,
timestamp: Date.parse(timestamp),
timestamp,
contents,
instance,
});