Skip to content

Commit

Permalink
add sorting functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
AmanRathoreP committed Jul 23, 2024
1 parent bbef9cb commit 889fa67
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/api/implementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,20 @@ var customColumns = class extends ExtensionCommon.ExtensionAPI {
}

var callback = field == "persianDate" ? persianDate : getEmpty;
var sort_callback = (message) => {
return field == "persianDate"
? Math.floor(message.date / 1000000)
: 0;
};

ThreadPaneColumns.addCustomColumn(id, {
name: name,
hidden: false,
icon: false,
resizable: true,
sortable: false,
textCallback: callback
sortable: true,
textCallback: callback,
sortCallback: sort_callback,
});
},

Expand Down

0 comments on commit 889fa67

Please sign in to comment.