Fixed bug with dates