diff --git a/XVBA/新版着工要因閲覧シート/vba-files/Module/Module1.bas b/XVBA/新版着工要因閲覧シート/vba-files/Module/Module1.bas index 713b3359..2359f977 100644 --- a/XVBA/新版着工要因閲覧シート/vba-files/Module/Module1.bas +++ b/XVBA/新版着工要因閲覧シート/vba-files/Module/Module1.bas @@ -437,11 +437,7 @@ Function getRecordsDataToSheet(records As Collection, targetSheet As String) Dim curRec As Dictionary Set curRec = flatRecords(i) For j = 1 To maxCols - If IsObject(curRec(headerKeys(j - 1))) Then - dataArr(i, j) = "" - Else - dataArr(i, j) = curRec(headerKeys(j - 1)) - End If + dataArr(i, j) = NormalizeGetValue(curRec(headerKeys(j - 1))) Next j Next i @@ -472,6 +468,29 @@ Function getRecordsDataToSheet(records As Collection, targetSheet As String) Debug.Print "R[h̃V[go͊: " & targetSheet End Function +'****************************************************************************** +'GetŎ擾l̂AISO8601`̓t𐳋K +'YYYY-MM-DDThh:mm:ss` "yyyy/mm/dd"Aݒ1899-12-30͋󗓂ɂ +'IuWFNgliJSONz񓙁j͋󗓂ɂ +Function NormalizeGetValue(ByVal v As Variant) As Variant + If IsObject(v) Then + NormalizeGetValue = "" + Exit Function + End If + + Dim s As String + s = CStr(v) + If Len(s) >= 10 And Mid(s, 5, 1) = "-" And Mid(s, 8, 1) = "-" And Mid(s, 11, 1) = "T" Then + If Left(s, 10) = "1899-12-30" Then + NormalizeGetValue = "" + Else + NormalizeGetValue = Mid(s, 1, 4) & "/" & Mid(s, 6, 2) & "/" & Mid(s, 9, 2) + End If + Else + NormalizeGetValue = v + End If +End Function + '****************************************************************************** 'REST APIďo '@method@GetPOST