fixing bug in weekday-before-or-self template