fixed issue when adding multiple missing entries

This commit is contained in:
Trey t
2022-02-17 17:50:17 -06:00
parent 2130b621d1
commit 7b828cc93c
3 changed files with 7 additions and 2 deletions

View File

@@ -56,7 +56,10 @@ extension PersistenceController {
let existingEntriesSet = Set(existingEntries)
let missing = Array(allDatesSet.subtracting(existingEntriesSet)).sorted(by: >)
for date in missing {
add(mood: .missing, forDate: date, entryType: .listView)
// add 12 hours, if you enter a things right at 12:00.00 it wont show .... mabye
// due to utc offset?
let adjustedDate = Calendar.current.date(byAdding: .hour, value: 12, to: date)!
add(mood: .missing, forDate: adjustedDate, entryType: .filledInMissing)
}
}
}