Commit 29f21530 by Takatoshi Miura

並び順が一意に決まらない不具合を修正

parent 4b2305a4
......@@ -2848,19 +2848,39 @@ CHK.createOperationList = function(operationList, isSearched = false) {
}
switch(sortType) {
case CHK_CONSTANT.SORT_TYPE.NAME:
operationList.sort((a, b) => (a.operationName > b.operationName) ? 1 : -1);
operationList.sort(function(a,b) {
if (a.operationName > b.operationName) return 1;
if (a.operationName < b.operationName) return -1;
return 0;
});
break;
case CHK_CONSTANT.SORT_TYPE.START_DATE_DESC:
operationList.sort((a, b) => (setOperationDate(a.operationStartDate) < setOperationDate(b.operationStartDate)) ? 1 : -1);
operationList.sort(function(a,b) {
if (setOperationDate(a.operationStartDate) < setOperationDate(b.operationStartDate)) return 1;
if (setOperationDate(a.operationStartDate) > setOperationDate(b.operationStartDate)) return -1;
return 0;
});
break;
case CHK_CONSTANT.SORT_TYPE.START_DATE_ASC:
operationList.sort((a, b) => (setOperationDate(a.operationStartDate) > setOperationDate(b.operationStartDate)) ? 1 : -1);
operationList.sort(function(a,b) {
if (setOperationDate(a.operationStartDate) > setOperationDate(b.operationStartDate)) return 1;
if (setOperationDate(a.operationStartDate) < setOperationDate(b.operationStartDate)) return -1;
return 0;
});
break;
case CHK_CONSTANT.SORT_TYPE.TYPE:
operationList.sort((a, b) => (a.operationType < b.operationType) ? 1 : -1);
operationList.sort(function(a,b) {
if (a.operationType < b.operationType) return 1;
if (a.operationType > b.operationType) return -1;
return 0;
});
break;
case CHK_CONSTANT.SORT_TYPE.LAST_EDIT_DATE:
operationList.sort((a, b) => (a.lastEditDate < b.lastEditDate) ? 1 : -1);
operationList.sort(function(a,b) {
if (a.lastEditDate < b.lastEditDate) return 1;
if (a.lastEditDate > b.lastEditDate) return -1;
return 0;
});
break;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment