Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -351,14 +351,17 @@
// sort function
scope.sortBy = function (item) {
if (scope.sortColumn === "updateDate") {
return [-item['isFolder'],item['updateDate']];
return [-item['isFolder'],parseUpdateDate(item['updateDate'])];
}
else {
return [-item['isFolder'],item['name']];
}
};


function parseUpdateDate(date) {
var parsedDate = Date.parse(date);
return isNaN(parsedDate) ? date : parsedDate;
}

Check warning on line 364 in src/Umbraco.Web.UI.Client/src/common/directives/components/umbmediagrid.directive.js

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (v13/dev)

❌ Getting worse: Complex Method

MediaGridDirective.link increases in cyclomatic complexity from 46 to 47, threshold = 9. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.
}

var directive = {
Expand Down
Loading