summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/parse.rs6
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
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback