Skip to content

Commit

Permalink
Added aria label with raw text
Browse files Browse the repository at this point in the history
  • Loading branch information
Erallie committed Dec 13, 2024
1 parent a935dc0 commit 26764cc
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -429,15 +429,15 @@ class TimestampModal extends Modal {
while (child) {
const nextChild = child.nextSibling;
child.addClass('timestamp-buttons');
let timestampStr: string;
if (child.id == "unix")
timestampStr = date.utc().format('X');
else
timestampStr = `<t:${date.utc().format('X')}:${child.id}>`;
child.ariaLabel = timestampStr;
child.onClickEvent((ev) => {
let insertedText: string;
let button = ev.currentTarget as HTMLButtonElement;
if (button.id == "unix")//
insertedText = date.utc().format('X');
else
insertedText = `<t:${date.utc().format('X')}:${button.id}>`;
editor.replaceSelection(insertedText);
editor.setCursor(cursor.line, cursor.ch + insertedText.length);
editor.replaceSelection(timestampStr);
editor.setCursor(cursor.line, cursor.ch + timestampStr.length);

let historyList = plugin.settings.history;
let newTimestamp = `${input.value} ${timezone.value}`
Expand Down

0 comments on commit 26764cc

Please sign in to comment.