Sha256: 266234b398ef1268be839b0446ad60d7c515e2c310f25c2081e393da95da6f0f
Contents?: true
Size: 667 Bytes
Versions: 8
Compression:
Stored size: 667 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
8 entries across 8 versions & 1 rubygems