Skip to content

Commit

Permalink
Fix journal format strings
Browse files Browse the repository at this point in the history
  • Loading branch information
nathansobo committed Dec 18, 2021
1 parent 34edbc7 commit 29bc2db
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/journal/src/journal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ pub fn new_journal_entry(app_state: Arc<AppState>, cx: &mut MutableAppContext) {

let journal_dir = home_dir.join("journal");
let month_dir = journal_dir
.join(format!("{:2}", now.year()))
.join(format!("{:2}", now.month()));
let entry_path = month_dir.join(format!("{:2}.md", now.day()));
.join(format!("{:02}", now.year()))
.join(format!("{:02}", now.month()));
let entry_path = month_dir.join(format!("{:02}.md", now.day()));
let now = now.time();
let (pm, hour) = now.hour12();
let am_or_pm = if pm { "PM" } else { "AM" };
let entry_heading = format!("# {}:{:2} {}\n\n", hour, now.minute(), am_or_pm);
let entry_heading = format!("# {}:{:02} {}\n\n", hour, now.minute(), am_or_pm);

let create_entry = cx.background().spawn(async move {
std::fs::create_dir_all(month_dir)?;
Expand Down

0 comments on commit 29bc2db

Please sign in to comment.