Update date to accept epoch

This commit is contained in:
Christopher H. Laco
2010-11-07 20:41:41 -05:00
parent 0526348cae
commit 33ecb29d49
2 changed files with 7 additions and 0 deletions
+4
View File
@@ -158,6 +158,10 @@ module Liquid
return input.to_s
end
if ((input.is_a?(String) && !/^\d+$/.match(input.to_s).nil?) || input.is_a?(Integer)) && input.to_i > 0
input = Time.at(input.to_i)
end
date = input.is_a?(String) ? Time.parse(input) : input
if date.respond_to?(:strftime)