Permalink
Browse files

Add support for Ruby < 1.9

  • Loading branch information...
1 parent cc83501 commit ce8e1afba6574c1e2de651798c02be4e308c7dd6 @dhilgarth committed Mar 3, 2013
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/jekyll/post.rb
View
@@ -87,7 +87,9 @@ def read_yaml(base, name)
#
# Returns -1, 0, 1
def <=>(other)
- cmp = self.date.to_date <=> other.date.to_date
+ cmp = self.date.year <=> other.date.year
+ cmp = self.date.month <=> other.date.month if cmp == 0
+ cmp = self.date.day <=> other.date.day if cmp == 0
if 0 == cmp
cmp = self.slug <=> other.slug
end

0 comments on commit ce8e1af

Please sign in to comment.