commit
c16a2f4d6a
|
@ -315,7 +315,7 @@ module Jekyll
|
||||||
def time(input)
|
def time(input)
|
||||||
case input
|
case input
|
||||||
when Time
|
when Time
|
||||||
input
|
input.clone
|
||||||
when Date
|
when Date
|
||||||
input.to_time
|
input.to_time
|
||||||
when String
|
when String
|
||||||
|
|
|
@ -103,6 +103,13 @@ class TestFilters < JekyllUnitTest
|
||||||
should "format a time according to RFC-822" do
|
should "format a time according to RFC-822" do
|
||||||
assert_equal "Wed, 27 Mar 2013 11:22:33 +0000", @filter.date_to_rfc822(@sample_time)
|
assert_equal "Wed, 27 Mar 2013 11:22:33 +0000", @filter.date_to_rfc822(@sample_time)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
should "not modify a time in-place when using filters" do
|
||||||
|
t = Time.new(2004, 9, 15, 0, 2, 37, "+01:00")
|
||||||
|
assert_equal 3600, t.utc_offset
|
||||||
|
@filter.date_to_string(t)
|
||||||
|
assert_equal 3600, t.utc_offset
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "with Date object" do
|
context "with Date object" do
|
||||||
|
|
Loading…
Reference in New Issue