mirror of
https://github.com/playmean/obsidian-event-highlight-plugin.git
synced 2026-07-22 05:44:13 +00:00
42 lines
1.2 KiB
TypeScript
42 lines
1.2 KiB
TypeScript
|
|
import { App, PluginSettingTab, Setting } from 'obsidian';
|
||
|
|
|
||
|
|
import Plugin from './main';
|
||
|
|
|
||
|
|
export class SettingsTab extends PluginSettingTab {
|
||
|
|
plugin: Plugin;
|
||
|
|
|
||
|
|
constructor(app: App, plugin: Plugin) {
|
||
|
|
super(app, plugin);
|
||
|
|
|
||
|
|
this.plugin = plugin;
|
||
|
|
}
|
||
|
|
|
||
|
|
display(): void {
|
||
|
|
let { containerEl } = this;
|
||
|
|
|
||
|
|
containerEl.empty();
|
||
|
|
|
||
|
|
new Setting(containerEl).setName('Display date format').addText((text) =>
|
||
|
|
text
|
||
|
|
.setPlaceholder('MMMM dd, yyyy')
|
||
|
|
.setValue(this.plugin.settings.dateFormat)
|
||
|
|
.onChange(async (value) => {
|
||
|
|
this.plugin.settings.dateFormat = value;
|
||
|
|
|
||
|
|
await this.plugin.saveSettings();
|
||
|
|
}),
|
||
|
|
);
|
||
|
|
|
||
|
|
new Setting(containerEl).setName('Display date/time format').addText((text) =>
|
||
|
|
text
|
||
|
|
.setPlaceholder('MMMM dd, yyyy HH:mm')
|
||
|
|
.setValue(this.plugin.settings.dateTimeFormat)
|
||
|
|
.onChange(async (value) => {
|
||
|
|
this.plugin.settings.dateTimeFormat = value;
|
||
|
|
|
||
|
|
await this.plugin.saveSettings();
|
||
|
|
}),
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|