new notes, patterns
This commit is contained in:
@@ -146,7 +146,7 @@ fn update_notes(notes_path: &PathBuf, patterns_path: Option<PathBuf>) {
|
||||
for p in &positions {
|
||||
match p.pattern {
|
||||
Pattern::Monthly { dom } => {
|
||||
let mut date_idx = latest_date.clone();
|
||||
let mut date_idx = latest_date.clone() + Duration::days(1);
|
||||
while date_idx <= today {
|
||||
if date_idx.day() == dom {
|
||||
writeln!(str_buf1, "- [ ] {}", &p.name)
|
||||
@@ -157,7 +157,7 @@ fn update_notes(notes_path: &PathBuf, patterns_path: Option<PathBuf>) {
|
||||
}
|
||||
}
|
||||
Pattern::MonthlyOpt { dom, ref months } => {
|
||||
let mut date_idx = latest_date.clone();
|
||||
let mut date_idx = latest_date.clone() + Duration::days(1);
|
||||
while date_idx <= today {
|
||||
if date_idx.day() == dom && months.contains(&month_from_date(date_idx)) {
|
||||
writeln!(str_buf1, "- [ ] {}", &p.name)
|
||||
@@ -169,7 +169,7 @@ fn update_notes(notes_path: &PathBuf, patterns_path: Option<PathBuf>) {
|
||||
}
|
||||
Pattern::Weekly { dow } => {
|
||||
dbg!(dow, today);
|
||||
let mut date_idx = latest_date.clone();
|
||||
let mut date_idx = latest_date.clone() + Duration::days(1);
|
||||
while date_idx <= today {
|
||||
dbg!(date_idx);
|
||||
if date_idx.weekday() == dow {
|
||||
|
||||
Reference in New Issue
Block a user