Fix merge condition for prices.csv

This commit is contained in:
2023-06-23 14:01:13 +09:00
parent b31c9a8b86
commit e9ab446a89

View File

@@ -30,11 +30,11 @@ extension KissConsole {
try [price].mergeCsv(toFile: fileUrl, merging: { this, file in
var merged = this
for old in file {
if nil == this.first(where: { $0.stockBusinessDate == old.stockBusinessDate }) {
if nil == this.first(where: { $0.stockDateTime == old.stockDateTime }) {
merged.append(old)
}
}
merged.sort(by: { $0.stockBusinessDate > $1.stockBusinessDate })
merged.sort(by: { $0.stockDateTime > $1.stockDateTime })
return merged
}, localized: false)