I have been using this function over years to do my weekly review shown in Fig. 1. It is based on ts library.

You can use it with yas-expand-from-trigger-key with minimal effort.

1
2
** TODO `(format "%s%02d%02d" (ts-year (ts-now))(ts-month (ts-now)) (ts-day (ts-now)))`-`(format "%s%02d%02d" (ts-year (ts-dec 'day -7 (ts-now))) (ts-month (ts-dec 'day -7 (ts-now))) (ts-day (ts-dec 'day -7 (ts-now))))` Week `(format "%02d" (+ (ts-week-of-year  (ts-now)) 1))`
   SCHEDULED: <`(format "%s-%02d-%02d" (ts-year (ts-dec 'day -7 (ts-now)))(ts-month (ts-dec 'day -7 (ts-now))) (ts-day (ts-dec 'day -7 (ts-now))))` 12:00>

Figure 1: Weekly review becomes a critical part of my habit.

Figure 1: Weekly review becomes a critical part of my habit.

Happy weekly reviewing.