categorize according to date