Generate one journal entry per day

Fixes #243
This commit is contained in:
Vishesh Handa
2020-09-16 11:01:38 +02:00
parent 0b7448e535
commit 265e253584
14 changed files with 95 additions and 34 deletions

View File

@ -93,3 +93,15 @@ String toCurlCommand(String url, Map<String, String> headers) {
Future<void> shareNote(Note note) async {
return Share.share(note.body);
}
Future<Note> getTodayJournalEntry(NotesFolderFS rootFolder) async {
var today = DateTime.now();
var matches = await rootFolder.matchNotes((n) async {
var dt = n.created;
return dt.year == today.year &&
dt.month == today.month &&
dt.day == today.day;
});
return matches.isNotEmpty ? matches[0] : null;
}