2022-04-21 11:57:45 +00:00
|
|
|
import { insertAtCursor } from "@silverbulletmd/plugos-silverbullet-syscall/editor";
|
2022-04-10 09:04:07 +00:00
|
|
|
|
|
|
|
const dateMatchRegex = /(\d{4}\-\d{2}\-\d{2})/g;
|
|
|
|
|
2022-04-11 18:34:09 +00:00
|
|
|
export function niceDate(d: Date): string {
|
2022-04-20 08:56:43 +00:00
|
|
|
return d.toISOString().split("T")[0];
|
2022-04-11 18:34:09 +00:00
|
|
|
}
|
|
|
|
|
2022-02-24 16:24:49 +00:00
|
|
|
export async function insertToday() {
|
2022-04-11 18:34:09 +00:00
|
|
|
await insertAtCursor(niceDate(new Date()));
|
2022-04-10 09:04:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export async function insertTomorrow() {
|
|
|
|
let d = new Date();
|
|
|
|
d.setDate(d.getDate() + 1);
|
2022-04-11 18:34:09 +00:00
|
|
|
await insertAtCursor(niceDate(d));
|
2022-02-24 16:24:49 +00:00
|
|
|
}
|