fix/improve parsing of last active dates

parseDT only uses the magic json.Unmarshal method if theres an error
with the better version. Error came from some times being sent without a
"Z" at the end denoting UTC.
This commit is contained in:
Harvey Tindall
2020-12-03 20:49:50 +00:00
parent 3c952d21f7
commit a1e30ff5db
7 changed files with 96 additions and 79 deletions
+1 -7
View File
@@ -1,14 +1,8 @@
import { rmAttr, addAttr, _post, _get, _delete } from "../modules/common.js";
import { rmAttr, addAttr, _post, _get, _delete, createEl } from "../modules/common.js";
export const Focus = (el: HTMLElement): void => rmAttr(el, 'unfocused');
export const Unfocus = (el: HTMLElement): void => addAttr(el, 'unfocused');
export function createEl(html: string): HTMLElement {
let div = document.createElement('div') as HTMLDivElement;
div.innerHTML = html;
return div.firstElementChild as HTMLElement;
}
export function storeDefaults(users: string | Array<string>): void {
const button = document.getElementById('storeDefaults') as HTMLButtonElement;
button.disabled = true;