Exception in template helper: ReferenceError: _date is not defined