1
0

Merge branch 'main' of github.com:silverbulletmd/silverbullet

This commit is contained in:
Zef Hemel 2022-11-09 09:35:29 +01:00
commit e42faec2e5
2 changed files with 6 additions and 0 deletions

View File

@ -105,6 +105,11 @@ export function replaceTemplateVars(s: string, pageName: string): string {
lastWeek.setDate(lastWeek.getDate() - 7); lastWeek.setDate(lastWeek.getDate() - 7);
return niceDate(lastWeek); return niceDate(lastWeek);
} }
case "nextWeek": {
const nextWeek = new Date();
nextWeek.setDate(nextWeek.getDate() + 7);
return niceDate(nextWeek);
}
case "page": case "page":
return pageName; return pageName;
} }

View File

@ -84,4 +84,5 @@ Currently supported (hardcoded in the code):
- `{{tomorrow}}`: Tomorrows date in the usual YYY-MM-DD format - `{{tomorrow}}`: Tomorrows date in the usual YYY-MM-DD format
- `{{yesterday}}`: Yesterdays date in the usual YYY-MM-DD format - `{{yesterday}}`: Yesterdays date in the usual YYY-MM-DD format
- `{{lastWeek}}`: Current date - 7 days - `{{lastWeek}}`: Current date - 7 days
- `{{nextWeek}}`: Current date + 7 days
- `{{page}}`: The name of the current page - `{{page}}`: The name of the current page