mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-10 08:38:32 +02:00
Cleans up entry
This commit is contained in:
parent
191ccb8217
commit
bf1048729c
1 changed files with 0 additions and 24 deletions
|
@ -85,27 +85,3 @@ class Entry:
|
|||
|
||||
def __ne__(self, other):
|
||||
return not self.__eq__(other)
|
||||
|
||||
def to_dict(self):
|
||||
return {
|
||||
'title': self.title,
|
||||
'body': self.body,
|
||||
'date': self.date.strftime("%Y-%m-%d"),
|
||||
'time': self.date.strftime("%H:%M"),
|
||||
'starred': self.starred
|
||||
}
|
||||
|
||||
def to_md(self):
|
||||
date_str = self.date.strftime(self.journal.config['timeformat'])
|
||||
body_wrapper = "\n\n" if self.body else ""
|
||||
body = body_wrapper + self.body
|
||||
space = "\n"
|
||||
md_head = "###"
|
||||
|
||||
return "{md} {date}, {title} {body} {space}".format(
|
||||
md=md_head,
|
||||
date=date_str,
|
||||
title=self.title,
|
||||
body=body,
|
||||
space=space
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue