Skip to content

Commit

Permalink
Merge pull request #810 from tdiary/sort_comment_on_add
Browse files Browse the repository at this point in the history
sort comments by date on a new comment added
  • Loading branch information
tdtds committed Oct 4, 2019
2 parents 5727e19 + 166faa8 commit f0b0b80
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
2019-08-17 Tada, Tadashi <t@tdtds.jp>
* sort commants by date on a new comment added

2019-08-15 HIGUCHI Daisuke (VDR dai) <dai@debian.org>
* amazon.rb: support HTTP Found response and discard wrong stored cache

Expand Down
2 changes: 1 addition & 1 deletion lib/tdiary/comment_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def init_comments

public
def add_comment( com )
@comments << com
(@comments << com).sort!{|a, b| a.date <=> b.date}
if not @last_modified or @last_modified < com.date
@last_modified = com.date
end
Expand Down
2 changes: 1 addition & 1 deletion lib/tdiary/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module TDiary
VERSION = '5.0.14.20190815'
VERSION = '5.0.14.20190817'
end

0 comments on commit f0b0b80

Please sign in to comment.