Fix template error caused when no date is given