molten-trunk/molten5/lib/shutdown_dates.rb
def start_dates
    begin
      num_dates = AppSetting.config("SHUTDOWN_DATES").to_i
    rescue
      num_dates = 0
    end
    dates = []
    0.upto(num_dates) { |i| 
      puts i
      begin
        begin_date = AppSetting.config("SHUTDOWN_DATE_RANGE{i}")
      rescue
        begin_date = ''
      end
      if (begin_date.length == 0)
        begin_date = AppConstants::SHUTDOWN_DATES[0]
      else
        begin_date = Date.strptime(begin_date.split(',')[0],fmt='%m/%d/%Y')
      end
      dates.push(begin_date)
    }
    return dates
  end
# Used to manage the shutdown dates from AppConstants and AppSetting. 

Used to manage the shutdown dates from AppConstants and AppSetting.
Used to manage the shutdown dates from AppConstants and AppSetting .
def start_dates
    begin
      num_dates = AppSetting.config("SHUTDOWN_DATES").to_i
    rescue
      num_dates = 0
    end
    dates = []
    0.upto(num_dates) { |i| 
      puts i
      begin
        begin_date = AppSetting.config("SHUTDOWN_DATE_RANGE{i}")
      rescue
        begin_date = ''
      end
      if (begin_date.length == 0)
        begin_date = AppConstants::SHUTDOWN_DATES[0]
      else
        begin_date = Date.strptime(begin_date.split(',')[0],fmt='%m/%d/%Y')
      end
      dates.push(begin_date)
    }
    return dates
  end
def start_dates begin num_dates = AppSetting . config ( "SHUTDOWN_DATES" ) . to_i rescue num_dates = 0 end dates = [ ] 0 . upto ( num_dates ) { | i | puts i begin begin_date = AppSetting . config ( "SHUTDOWN_DATE_RANGE{i}" ) rescue begin_date = '' end if ( begin_date . length == 0 ) begin_date = AppConstants :: SHUTDOWN_DATES [ 0 ] else begin_date = Date . strptime ( begin_date . split ( ',' ) [ 0 ] , fmt = '%m/%d/%Y' ) end dates . push ( begin_date ) } return dates end
Used to manage the shutdown dates from AppConstants and AppSetting.
Used to manage the shutdown dates from AppConstants and AppSetting .