Sha256: fc0f85735475ad179a28c8a684fc8de619577a3be619d4def405235e41875316
Contents?: true
Size: 673 Bytes
Versions: 23
Compression:
Stored size: 673 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
23 entries across 23 versions & 1 rubygems