mirror of
https://github.com/munckenh/obsidian-relative-dates.git
synced 2026-07-22 06:43:16 +00:00
refactor: use createSpan()
This commit is contained in:
parent
bf0b3bd89a
commit
0bb5d85d53
2 changed files with 2 additions and 1 deletions
|
|
@ -17,6 +17,7 @@ export default defineConfig([
|
|||
...globals.browser,
|
||||
createFragment: 'readonly',
|
||||
activeDocument: 'readonly',
|
||||
createSpan: 'readonly',
|
||||
},
|
||||
parser: tsparser,
|
||||
parserOptions: {
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ export function createDateElement(
|
|||
date: Moment,
|
||||
onClick?: () => void,
|
||||
): HTMLElement {
|
||||
const span = activeDocument.createElement('span');
|
||||
const span = createSpan();
|
||||
span.textContent = getRelativeText(date);
|
||||
span.className = 'relative-date';
|
||||
span.dataset.category = getDateCategory(date);
|
||||
|
|
|
|||
Loading…
Reference in a new issue