If the input is a string but Time.parse can't parse it, maybe it's a UNIX timestamp.

Fixes #2339
This commit is contained in:
Parker Moore 2014-05-07 15:48:13 -04:00
parent a6af5e26bc
commit 348bcae763
1 changed files with 3 additions and 1 deletions

View File

@ -230,7 +230,9 @@ module Jekyll
when Time
input
when String
Time.parse(input)
Time.parse(input) rescue Time.at(input.to_i)
when Number
Time.at(input)
else
Jekyll.logger.error "Invalid Date:", "'#{input}' is not a valid datetime."
exit(1)