mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-10 16:48:31 +02:00
parent
c508e0c574
commit
aae0fc21b6
1 changed files with 4 additions and 1 deletions
|
@ -14,13 +14,16 @@ class JSONExporter(TextExporter):
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def entry_to_dict(cls, entry):
|
def entry_to_dict(cls, entry):
|
||||||
return {
|
entry_dict = {
|
||||||
'title': entry.title,
|
'title': entry.title,
|
||||||
'body': entry.body,
|
'body': entry.body,
|
||||||
'date': entry.date.strftime("%Y-%m-%d"),
|
'date': entry.date.strftime("%Y-%m-%d"),
|
||||||
'time': entry.date.strftime("%H:%M"),
|
'time': entry.date.strftime("%H:%M"),
|
||||||
'starred': entry.starred
|
'starred': entry.starred
|
||||||
}
|
}
|
||||||
|
if hasattr(entry, "uuid"):
|
||||||
|
entry_dict['uuid'] = entry.uuid
|
||||||
|
return entry_dict
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def export_entry(cls, entry):
|
def export_entry(cls, entry):
|
||||||
|
|
Loading…
Add table
Reference in a new issue