Add nextWeek template variable (#109)
This commit is contained in:
parent
bb6bf289d9
commit
334550675a
@ -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;
|
||||||
}
|
}
|
||||||
|
@ -84,4 +84,5 @@ Currently supported (hardcoded in the code):
|
|||||||
- `{{tomorrow}}`: Tomorrow’s date in the usual YYY-MM-DD format
|
- `{{tomorrow}}`: Tomorrow’s date in the usual YYY-MM-DD format
|
||||||
- `{{yesterday}}`: Yesterday’s date in the usual YYY-MM-DD format
|
- `{{yesterday}}`: Yesterday’s 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
|
||||||
|
Loading…
Reference in New Issue
Block a user