src/backup/prune.rs: prune - correctly use iso_week year

This commit is contained in:
Dietmar Maurer 2019-12-06 19:41:38 +01:00
parent 84322d8c75
commit 052c4aa160

View File

@ -150,7 +150,11 @@ pub fn compute_prune_info(
if let Some(keep_weekly) = options.keep_weekly {
mark_selections(&mut mark, &list, keep_weekly as usize, |local_time, _info| {
format!("{}/{}", local_time.year(), local_time.iso_week().week())
let iso_week = local_time.iso_week();
let week = iso_week.week();
// Note: This year number might not match the calendar year number.
let iso_week_year = iso_week.year();
format!("{}/{}", iso_week_year, week);
});
}