utils/date.utils.js
function datePlusFrequency(date, frequency) {
        var minutes;

        date = date || new Date();  // default is today
        frequency = frequency || 'hourly';  // default is hourly

        switch (frequency) {
            case 'none':
                minutes = 525949;  // set far in future
                break;
            case 'instant':
                minutes = 1;
                break;
            case 'hourly':
                minutes = 60;
                break;
            case 'daily':
                minutes = 1440;
                break;
            case 'weekly':
                minutes = 10080;
                break;
            default:
                minutes = 0;
        }

        return new Date(date.getTime() + (minutes * 60000));
    }
function datePlusFrequency(date, frequency) {
        var minutes;

        date = date || new Date();  // default is today
        frequency = frequency || 'hourly';  // default is hourly

        switch (frequency) {
            case 'none':
                minutes = 525949;  // set far in future
                break;
            case 'instant':
                minutes = 1;
                break;
            case 'hourly':
                minutes = 60;
                break;
            case 'daily':
                minutes = 1440;
                break;
            case 'weekly':
                minutes = 10080;
                break;
            default:
                minutes = 0;
        }

        return new Date(date.getTime() + (minutes * 60000));
    }
function datePlusFrequency ( date , frequency ) { var minutes ; date = date || new Date ( ) ; // default is today frequency = frequency || 'hourly' ; // default is hourly switch ( frequency ) { case 'none' : minutes = 525949 ; // set far in future break ; case 'instant' : minutes = 1 ; break ; case 'hourly' : minutes = 60 ; break ; case 'daily' : minutes = 1440 ; break ; case 'weekly' : minutes = 10080 ; break ; default : minutes = 0 ; } return new Date ( date . getTime ( ) + ( minutes * 60000 ) ) ; }
Get a date in the future based off the frequency
@param date The starting date
@param frequency [none, instant, hourly, daily, weekly]
Get a date in the future based off the frequency