Add ISO dates to search so we can query by them

This commit is contained in:
2025-05-24 14:52:09 +02:00
parent 29f6f28f12
commit 64884cbb42

View File

@@ -350,6 +350,7 @@ Future<Note> createNote(String content) async {
final document = {
'id': generateRandomString(32),
'date': DateTime.now().toUtc().millisecondsSinceEpoch,
'dateISO': DateTime.now().toUtc().toIso8601String(),
'content': content,
'topLetter': mostFrequentLetter,
'topLetterFrequency': mostFrequentLetterCount,
@@ -433,6 +434,10 @@ Future<void> updateNote(Note note) async {
'id': note.id,
'content': trimmedContent,
'date': note.epochTime,
'dateISO':
DateTime.fromMillisecondsSinceEpoch(
note.epochTime,
).toUtc().toIso8601String(),
'topLetter': mostFrequentLetter,
'topLetterFrequency': mostFrequentLetterRatio,
};