new notes, patterns

This commit is contained in:
2026-02-16 12:21:09 +01:00
parent a316a1ebc4
commit 005a760c60
5 changed files with 135 additions and 5 deletions

View File

@@ -41,7 +41,7 @@
),
(
name: "Semesterbeitrag überweisen",
pattern: MonthlyOpt(dom: 10, months: ["February", "August"]),
pattern: MonthlyOpt(dom: 20, months: ["February", "August"]),
),
(
name: "Semesterbescheinigung an Musikschule",

View File

@@ -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 {