Skip to content
Snippets Groups Projects
Commit 014185ea authored by wajeeha-khalid's avatar wajeeha-khalid
Browse files

Merge pull request #12145 from edx/jia/TNL-3818-refactor

refactored variable name
parents 00d2d6d2 e0208690
No related merge requests found
......@@ -118,14 +118,13 @@ if Backbone?
pinnedThreadsSortComparatorWithDate: (thread, ascending)->
# if threads are pinned they should be displayed on top.
# Unpinned will be sorted by their last activity date
threadCreatedTime = new Date(thread.get("created_at")).getTime()
threadCreatedTime = new Date(thread.get("last_activity_at")).getTime()
threadLastActivityAtTime = new Date(thread.get("last_activity_at")).getTime()
if thread.get('pinned')
#use tomorrow's date
today = new Date();
preferredDate = new Date(today.getTime() + (24 * 60 * 60 * 1000) + threadCreatedTime);
preferredDate = new Date(today.getTime() + (24 * 60 * 60 * 1000) + threadLastActivityAtTime);
else
preferredDate = threadCreatedTime
preferredDate = threadLastActivityAtTime
if ascending
preferredDate
else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment