Sha256: 0e7899da67963c9b94fb9263b923367d98eaf765709fa600e6b6726307388a55
Contents?: true
Size: 558 Bytes
Versions: 3
Compression:
Stored size: 558 Bytes
Contents
require 'json' module Sidekiq module Statistic module WebExtensionHelper DAFAULT_DAYS = 20 def formate_date(string, format = nil) time = string ? Time.parse(string) : Time.now time.strftime(format || '%T, %e %B %Y') end def calculate_date_range(params) if params['dateFrom'] && params['dateTo'] from = Date.parse(params['dateFrom']) to = Date.parse(params['dateTo']) [(to - from).to_i, to] else [DAFAULT_DAYS] end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems