Merged pull request #34 from claco/date-epoch.

Epoch support
This commit is contained in:
Tobias Lütke
2011-04-25 09:03:30 -07:00
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)