diff options
author | Matthew Sotoudeh <matthewsot@outlook.com> | 2022-01-24 08:24:13 -0800 |
---|---|---|
committer | Matthew Sotoudeh <matthewsot@outlook.com> | 2022-01-24 08:24:13 -0800 |
commit | 3861cba4a2b3abfd014e1a96743b60acccbeaba6 (patch) | |
tree | 8d922b34da8412d50cdfc2be89d69d3926203ff5 | |
parent | d9fac382c8d3b60f6ea641d175326d4e6bc678ff (diff) |
Be a bit more lenient about the format of week filesadvanced
It may be nice to keep the header
-rw-r--r-- | src/parse.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/parse.rs b/src/parse.rs index 6bed4d9..d7a6e2b 100644 --- a/src/parse.rs +++ b/src/parse.rs @@ -32,11 +32,11 @@ fn parse_file_str(file_str: &str, implicit_week: Option<NaiveDate>) -> Vec<Task> let mut the_date = None; for l in file_str.split('\n') { if l.starts_with("# ") { - if implicit_week.is_some() { - panic!("Cannot use '# ' headers in a weekly.md or [week].md file!"); - } // '# 12/27/21', starts a new week block start_date = parse_date_line(l); + if implicit_week.is_some() && start_date != implicit_week { + panic!("Cannot use different '# ' headers in a weekly.md or [week].md file!"); + } } else if l.starts_with("## ") { // '## Monday/Tuesday/...', starts a new day block // Need to compute the actual date, basically looking for the first one after |