fix post sorting issue

This commit is contained in:
Torsten Ruger
2018-04-22 13:35:13 +03:00
parent 4f3d33c322
commit 33953445b7
35 changed files with 5 additions and 10 deletions

View File

@ -21,10 +21,10 @@ class Post
@words.join(" ")
end
def template_name
"#{date}-#{@words.join("-")}"
"#{year}-#{month.to_s.rjust(2, '0')}-#{day.to_s.rjust(2, '0')}-#{@words.join("-")}"
end
def date
"#{year}-#{month}-#{day}"
Date.new(year,month,day)
end
def parse_int( value , max)
ret = value.to_i