Commit cafb403b by NGO THI HONG

Update sort operationList

parent fc242179
......@@ -53,7 +53,7 @@
"operationStartDate": "2022-08-22",
"operationEndDate": "2022-08-22",
"operationStatus": 1,
"operationLastEditDate": "2022-08-22 16:43:40",
"operationLastEditDate": "2022-08-23 16:43:40",
"enableReportHistory": 0,
"enableAddReport": 1,
"quickReport": 0,
......@@ -77,7 +77,7 @@
"operationStartDate": "2022-08-22",
"operationEndDate": "2022-08-22",
"operationStatus": 1,
"operationLastEditDate": "2022-08-22 16:44:20",
"operationLastEditDate": "2022-08-24 16:44:20",
"reportCycle": 0,
"enableReportUpdate": 1,
"enableReportHistory": 0,
......@@ -103,7 +103,7 @@
"operationStartDate": "2022-08-22",
"operationEndDate": "2022-08-22",
"operationStatus": 1,
"operationLastEditDate": "2022-08-22 16:46:13",
"operationLastEditDate": "2022-08-25 16:46:13",
"enableReportHistory": 0,
"enableAddReport": 1,
"quickReport": 0,
......@@ -136,7 +136,7 @@
"operationStartDate": "2022-08-22",
"operationEndDate": "2022-08-22",
"operationStatus": 1,
"operationLastEditDate": "2022-08-22 16:46:26",
"operationLastEditDate": "2022-08-26 16:46:26",
"enableReportHistory": 0,
"enableAddReport": 1,
"quickReport": 0,
......@@ -169,7 +169,7 @@
"operationStartDate": "2022-08-22",
"operationEndDate": "2022-08-22",
"operationStatus": 1,
"operationLastEditDate": "2022-08-22 19:05:48",
"operationLastEditDate": "2022-08-27 19:05:48",
"enableReportHistory": 0,
"enableAddReport": 1,
"quickReport": 0,
......@@ -223,7 +223,7 @@
"operationStartDate": "2022-08-22",
"operationEndDate": "2022-08-22",
"operationStatus": 1,
"operationLastEditDate": "2022-08-22 16:52:15",
"operationLastEditDate": "2022-08-28 16:52:15",
"enableReportHistory": 0,
"enableAddReport": 1,
"quickReport": 0,
......
......@@ -23,6 +23,17 @@ CHK_pu.init = function() {
// 作業一覧JSONデータ
CHK.loadJson(CHK.jsonPath.operationList, function (json) {
CHK.operation = json;
CHK.operation.operationList = CHK.operation.operationList.sort(function(a,b) {
if (!a.operationLastEditDate) {
a.operationLastEditDate = "1900-01-01 09:00:00";
}
if (!b.operationLastEditDate) {
b.operationLastEditDate = "1900-01-01 09:00:00";
}
if (a.operationLastEditDate < b.operationLastEditDate) return 1;
if (a.operationLastEditDate > b.operationLastEditDate) return -1;
return 0;
});
CHK_pu.createNewReportList(CHK.operation.operationList);
CHK_pu.createContinueWorkList(CHK.operation.operationList);
CHK_pu.createReportWithWarning(CHK.operation.operationList);
......
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