summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFredrik Meringdal <fmeringdal@hotmail.com>2020-10-17 13:43:14 +0200
committerFredrik Meringdal <fmeringdal@hotmail.com>2020-10-17 13:43:14 +0200
commit22c088275d0e1e58d65751e50552ea41a2e10b98 (patch)
tree1f1179d1b1dfad2fa418571b6c215ede2b013aa3 /src
parentfd9900ff233b6cc9107805e5e0e401a89d7dbd78 (diff)
downloadrust_rrule-22c088275d0e1e58d65751e50552ea41a2e10b98.zip
hourly fixes again
Diffstat (limited to 'src')
-rw-r--r--src/iter.rs7
-rw-r--r--src/iterinfo.rs4
2 files changed, 9 insertions, 2 deletions
diff --git a/src/iter.rs b/src/iter.rs
index 561585e..dd1066a 100644
--- a/src/iter.rs
+++ b/src/iter.rs
@@ -106,8 +106,10 @@ pub fn iter(iter_result: &mut IterResult, options: &mut ParsedOptions) -> Vec<Da
Some(count) => count,
_ => 0,
};
+ println!("Timeset: {:?}", timeset);
loop {
+ println!("Counter date in loop: {}", counter_date);
let (dayset, start, end) = ii.getdayset(
&options.freq,
counter_date.year() as isize,
@@ -186,7 +188,9 @@ pub fn iter(iter_result: &mut IterResult, options: &mut ParsedOptions) -> Vec<Da
}
// Handle frequency and interval
+ println!("Before counter add: {}", counter_date);
counter_date = increment_counter_date(counter_date, options, filtered);
+ println!("After counter add: {}", counter_date);
if counter_date.year() > 2200 {
return iter_result.get_value();
@@ -196,6 +200,7 @@ pub fn iter(iter_result: &mut IterResult, options: &mut ParsedOptions) -> Vec<Da
|| options.freq == Frequenzy::MINUTELY
|| options.freq == Frequenzy::SECONDLY
{
+ println!("Getting timeset for counter date: {:?}", counter_date);
timeset = ii.gettimeset(
&options.freq,
counter_date.hour() as usize,
@@ -252,6 +257,7 @@ pub fn increment_counter_date(
Frequenzy::HOURLY => {
let mut new_hours = counter_date.hour() as usize;
if filtered {
+ println!("yeaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaah");
new_hours += ((23 - new_hours) as f32 / options.interval as f32).floor() as usize
* options.interval;
}
@@ -264,6 +270,7 @@ pub fn increment_counter_date(
.iter()
.any(|bh| *bh == (new_hours % 24) as usize)
{
+ println!("Broke at new hours: {}", new_hours);
break;
}
}
diff --git a/src/iterinfo.rs b/src/iterinfo.rs
index 083d4fa..18020d5 100644
--- a/src/iterinfo.rs
+++ b/src/iterinfo.rs
@@ -182,7 +182,7 @@ impl<'a> IterInfo<'a> {
.map(|minute| self.mtimeset(hour, *minute, second, millisecond))
.flatten()
.collect::<Vec<Time>>();
- set.sort_by_key(|a| -1 * (a.time() as isize));
+ set.sort_by_key(|a| a.time());
set
}
@@ -193,7 +193,7 @@ impl<'a> IterInfo<'a> {
.iter()
.map(|second| Time::new(hour, minute, *second, millisecond))
.collect::<Vec<Time>>();
- set.sort_by_key(|a| -1 * (a.time() as isize));
+ set.sort_by_key(|a| a.time());
set
}