<commit_before>class SimpleCalendarController < ApplicationController
  # For Rails version 2.0 to 2.1
  #self.view_paths << File.join(File.dirname(__FILE__), '..', 'views')
  # For Rails versions less than 2.0
  #self.template_root = File.join(File.dirname(__FILE__), '..', 'views')

  def index
  end
  
  def refresh_month
    render :update do |page| 
      page.replace_html :inner_calendar, :simple_calendar => session[:simple_calendar_name], :admin => session[:simple_calendar_admin], :layout => false, :month => params[:month], :year => params[:year]
    end
  end

  def refresh_year
    render :update do |page|
      page.replace_html :inner_calendar, :simple_calendar => session[:simple_calendar_name], :admin => session[:simple_calendar_admin], :layout => false, :year => params[:year], :month => params[:month]
    end
  end

  def day_view
    @mode = 'day'
    if !params[:date].nil?
      @year, @month, @day = params[:date].split('-')
    else
      @year = Time.now.year
      @month = Time.now.month
      @day  = Time.now.day
    end
    @date = Date.new(@year.to_i, @month.to_i, @day.to_i)

    @hours = ['12am', '1am', '2am', '3am', '4am', '5am', '6am', '7am', '8am', '9am', '10am', '11am', 
              '12pm', '1pm', '2pm', '3pm', '4pm', '5pm', '6pm', '7pm', '8pm', '9pm', '10pm', '11pm']

    render :action => 'index'
  end 

  def month_view
    @mode  = 'month'
    if !params[:date].nil?
      @date  = params[:date].to_date
      @day   = 1
      @month = @date.month
      @year  = @date.year
    else 
      @year = Time.now.year
      @month = Time.now.month
      @day = Time.now.day
    end
    @date = Date.new(@year.to_i, @month.to_i, @day.to_i)

    render :action => 'index'
  end
end<commit_msg>day should not be reset to 1 every time you go to month view<commit_after>class SimpleCalendarController < ApplicationController
  # For Rails version 2.0 to 2.1
  #self.view_paths << File.join(File.dirname(__FILE__), '..', 'views')
  # For Rails versions less than 2.0
  #self.template_root = File.join(File.dirname(__FILE__), '..', 'views')

  def index
  end
  
  def refresh_month
    render :update do |page| 
      page.replace_html :inner_calendar, :simple_calendar => session[:simple_calendar_name], :admin => session[:simple_calendar_admin], :layout => false, :month => params[:month], :year => params[:year]
    end
  end

  def refresh_year
    render :update do |page|
      page.replace_html :inner_calendar, :simple_calendar => session[:simple_calendar_name], :admin => session[:simple_calendar_admin], :layout => false, :year => params[:year], :month => params[:month]
    end
  end

  def day_view
    @mode = 'day'
    if !params[:date].nil?
      @year, @month, @day = params[:date].split('-')
    else
      @year = Time.now.year
      @month = Time.now.month
      @day  = Time.now.day
    end
    @date = Date.new(@year.to_i, @month.to_i, @day.to_i)

    @hours = ['12am', '1am', '2am', '3am', '4am', '5am', '6am', '7am', '8am', '9am', '10am', '11am', 
              '12pm', '1pm', '2pm', '3pm', '4pm', '5pm', '6pm', '7pm', '8pm', '9pm', '10pm', '11pm']

    render :action => 'index'
  end 

  def month_view
    @mode  = 'month'
    if !params[:date].nil?
      @date  = params[:date].to_date
      @day   = @date.day
      @month = @date.month
      @year  = @date.year
    else 
      @year = Time.now.year
      @month = Time.now.month
      @day = Time.now.day
    end
    @date = Date.new(@year.to_i, @month.to_i, @day.to_i)

    render :action => 'index'
  end
end
{'fraction_non_alphanumeric': 0.17275559331634097, 'fraction_numerical': 0.02095723591050694, 'mean_word_length': 3.0365714285714285, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6637426', 'n_tokens_mistral': 1303, 'n_tokens_neox': 1254, 'n_words': 304}