mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-18 10:20:43 -07:00
Remove regex for downcase and is_a?(String)
This commit is contained in:
@@ -306,8 +306,10 @@ module Liquid
|
|||||||
def to_date(obj)
|
def to_date(obj)
|
||||||
return obj if obj.respond_to?(:strftime)
|
return obj if obj.respond_to?(:strftime)
|
||||||
|
|
||||||
|
obj = obj.downcase if obj.is_a?(String)
|
||||||
|
|
||||||
case obj
|
case obj
|
||||||
when /\A(?:now|today)\z/i
|
when 'now'.freeze, 'today'.freeze
|
||||||
Time.now
|
Time.now
|
||||||
when /\A\d+\z/, Integer
|
when /\A\d+\z/, Integer
|
||||||
Time.at(obj.to_i)
|
Time.at(obj.to_i)
|
||||||
|
|||||||
Reference in New Issue
Block a user