Skip to content

Commit

Permalink
Merge pull request #574 from flexo333/patch-1
Browse files Browse the repository at this point in the history
Add parameter to choose journal date format
  • Loading branch information
felixhao28 committed Jan 19, 2021
2 parents 291fc85 + f0ed713 commit 8307121
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions open_journal.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@
except ImportError:
from mdeutils import *


DEFAULT_DATE_FORMAT = '%Y-%m-%d'

class OpenJournalCommand(MDETextCommand):
def run(self, edit):
print("Running OpenJournalCommand")
today = date.today()
name = today.strftime('%Y-%m-%d')
date_format = self.view.settings().get("mde.journal.dateformat", DEFAULT_DATE_FORMAT)
name = today.strftime(date_format)

wiki_page = WikiPage(self.view)
wiki_page.select_page(name)

0 comments on commit 8307121

Please sign in to comment.