summaryrefslogtreecommitdiff
path: root/src/iterinfo.rs
diff options
context:
space:
mode:
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;