See SO post here: http://stackoverflow.com/questions/26239961/rehaping-data-based-on-date-objects-using-data-table