only show date, not hours, show 'laast aangepast op' instead of geschreven op

This commit is contained in:
Jens Timmerman 2020-10-12 23:47:58 +02:00
parent fbc76e8f7d
commit 804c0b1038
2 changed files with 4 additions and 4 deletions

View file

@ -28,7 +28,7 @@
<% end %> <% end %>
<div class="details animated fadeInRight"> <div class="details animated fadeInRight">
<small> <small>
Geschreven op <%= gitmtime %><br> Laatst aangepast op <%= gitmtime %><br>
Leestijd: <%= reading_time @item %> Leestijd: <%= reading_time @item %>
</small> </small>
</div> </div>

View file

@ -27,13 +27,13 @@ module BlogHelper
end end
def gitmtime def gitmtime
# find file extension # find file last modification time
filepath=@item[:content_filename] filepath=@item[:content_filename]
str=`git log -1 --format='%ci' -- #{filepath}` str=`git log -1 --format=%cd --date=short -- #{filepath}`
if str == "" if str == ""
return @item[:created_at] return @item[:created_at]
else else
return DateTime.parse( str ) return str
end end
end end
end end