Sha256: 30ffe39624cc881811c808ea2a3197aaa19afb2cdfe9b4d09713047a99d846d4
Contents?: true
Size: 671 Bytes
Versions: 16
Compression:
Stored size: 671 Bytes
Contents
module Hubstats class ApplicationController < ApplicationController before_filter :set_time # Private - Reads the cookie, and then either sets @start_date and @end_date to be the cookie's values # or sets them to be today + 1 and two weeks ago. # # Returns - nothing private def set_time cookie = cookies[:hubstats_dates] if cookie == nil || cookie.include?("null") @start_date = Date.today - 14 @end_date = Date.today + 1 else @start_date = cookies[:hubstats_dates].split("~~").first.to_date @end_date = cookies[:hubstats_dates].split("~~").last.to_date + 1 end end end end
Version data entries
16 entries across 16 versions & 1 rubygems