Extra d3 code for time scales