Module: IceCubeCron::Util
- Defined in:
- lib/ice_cube_cron/util.rb
Overview
:category: Utilities
Class Method Summary collapse
Class Method Details
.sanitize_date_param(date) ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/ice_cube_cron/util.rb', line 6 def self.sanitize_date_param(date) date = Date.parse(date) if date.is_a?(::String) date = date.to_time(:utc) if date.is_a?(::Date) && !date.is_a?(::DateTime) date = date.to_time.utc if date.is_a?(::DateTime) date = Time.at(date).utc if date.is_a?(::Integer) date end |