Date logic working