d3 magic on events in calendar