Adapt graph legend to view date

Unit test new functions of dateutils