From ce8e1afba6574c1e2de651798c02be4e308c7dd6 Mon Sep 17 00:00:00 2001 From: Daniel Hilgarth Date: Sun, 3 Mar 2013 15:12:21 +0100 Subject: [PATCH] Add support for Ruby < 1.9 --- lib/jekyll/post.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/jekyll/post.rb b/lib/jekyll/post.rb index c2d70199..ab912d82 100644 --- a/lib/jekyll/post.rb +++ b/lib/jekyll/post.rb @@ -87,7 +87,9 @@ module Jekyll # # 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