Add ISO dates to search so we can query by them
This commit is contained in:
@@ -350,6 +350,7 @@ Future<Note> createNote(String content) async {
|
|||||||
final document = {
|
final document = {
|
||||||
'id': generateRandomString(32),
|
'id': generateRandomString(32),
|
||||||
'date': DateTime.now().toUtc().millisecondsSinceEpoch,
|
'date': DateTime.now().toUtc().millisecondsSinceEpoch,
|
||||||
|
'dateISO': DateTime.now().toUtc().toIso8601String(),
|
||||||
'content': content,
|
'content': content,
|
||||||
'topLetter': mostFrequentLetter,
|
'topLetter': mostFrequentLetter,
|
||||||
'topLetterFrequency': mostFrequentLetterCount,
|
'topLetterFrequency': mostFrequentLetterCount,
|
||||||
@@ -433,6 +434,10 @@ Future<void> updateNote(Note note) async {
|
|||||||
'id': note.id,
|
'id': note.id,
|
||||||
'content': trimmedContent,
|
'content': trimmedContent,
|
||||||
'date': note.epochTime,
|
'date': note.epochTime,
|
||||||
|
'dateISO':
|
||||||
|
DateTime.fromMillisecondsSinceEpoch(
|
||||||
|
note.epochTime,
|
||||||
|
).toUtc().toIso8601String(),
|
||||||
'topLetter': mostFrequentLetter,
|
'topLetter': mostFrequentLetter,
|
||||||
'topLetterFrequency': mostFrequentLetterRatio,
|
'topLetterFrequency': mostFrequentLetterRatio,
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user