summaryrefslogtreecommitdiff
path: root/src/iterinfo.rs
diff options
context:
space:
mode:
authorFredrik Meringdal <fmeringdal@hotmail.com>2020-10-16 20:30:19 +0200
committerFredrik Meringdal <fmeringdal@hotmail.com>2020-10-16 20:30:19 +0200
commit329a7a8ab2e774258bfed34132aec51d3b19c01e (patch)
tree6433e8e47218b54d28bb9b705f3ddea66fd6365b /src/iterinfo.rs
parent4b8de559d303b9a7985599a85bc50df17908cb79 (diff)
downloadrust_rrule-329a7a8ab2e774258bfed34132aec51d3b19c01e.zip
bug fix for weeklydayset generation
Diffstat (limited to 'src/iterinfo.rs')
-rw-r--r--src/iterinfo.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/iterinfo.rs b/src/iterinfo.rs
index 5b9a8d6..a423be1 100644
--- a/src/iterinfo.rs
+++ b/src/iterinfo.rs
@@ -141,8 +141,8 @@ impl<'a> IterInfo<'a> {
}
pub fn wdayset(&self, year: isize, month: usize, day: usize) -> (Vec<usize>, usize, usize) {
- let year_len = self.yearlen().unwrap();
- let mut set = vec![0; year_len];
+ let set_len = self.yearlen().unwrap() + 7;
+ let mut set = vec![0; set_len];
let mut i = (to_ordinal(
&Utc.ymd(year as i32, month as u32, day as u32)
@@ -151,7 +151,7 @@ impl<'a> IterInfo<'a> {
let start = i;
for _ in 0..7 {
- if i >= year_len {
+ if i >= set_len {
break;
}
set[i] = i;