Added a check for nil dates to avoid it showing 1st of january instead