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