added more robust date handling to graph