function nextSchedule (schedule, allowNow = false) {
  if (schedule) {
    try {
      const dates = later.schedule(schedule).next(2)
      return nextDate(dates, allowNow)
    } catch (error) {
      throw TypeError('Invalid schedule definition')
    }
  }
  return null
}
function nextSchedule (schedule, allowNow = false) {
  if (schedule) {
    try {
      const dates = later.schedule(schedule).next(2)
      return nextDate(dates, allowNow)
    } catch (error) {
      throw TypeError('Invalid schedule definition')
    }
  }
  return null
}
function nextSchedule ( schedule , allowNow = false ) { if ( schedule ) { try { const dates = later . schedule ( schedule ) . next ( 2 ) return nextDate ( dates , allowNow ) } catch ( error ) { throw TypeError ( 'Invalid schedule definition' ) } } return null }
Get next time for a schedule. Will never return the current time, even if it
is valid for the schedule, unless `allowNow` is true.
@param {Object} schedule - The schedule
@param {boolean} allowNow - True to allow now as next Date
@returns {Date} The next Date
Get next time for a schedule . Will never return the current time even if it is valid for the schedule unless allowNow is true .