// This routine will update the database sales records to take the sales.date field which is YYYYMMDD and add sales.timestamp and sales.weekOfYear fields that duplicate the sales.date field but provide enhanced search capabilities.
// This routine does not change sales.date. It can be run repeatedly without any problems.
//
// The problems this solves:
// 1. Searching by the week of the year is faster since it does not need to be calculated.
// 2. Searching by using date routines is easier since a conversion from string to date is not required (it is also apparently not possible in the current version of MongoDB).
// 3. Keeping the date field as YYYYMMDD makes sorting and avoiding timezone conversion errors easier.
//
Meteor.methods({
// Cleans up all Date objects that don't have a time component. Removes any time component.