diff --git a/crates/atuin/src/command/client/wrapped.rs b/crates/atuin/src/command/client/wrapped.rs index 7fad19f5b8f..b0079412de8 100644 --- a/crates/atuin/src/command/client/wrapped.rs +++ b/crates/atuin/src/command/client/wrapped.rs @@ -89,7 +89,11 @@ impl WrappedStats { // Error analysis let mut command_errors: HashMap = HashMap::new(); // (total_uses, errors) - let midyear = history[0].timestamp + Duration::days(182); // Split year in half + + // Find number of days commands have been collected + let days = + (history[history.len() - 1].timestamp.ordinal() - history[0].timestamp.ordinal()) / 2; + let midyear = history[0].timestamp + Duration::days(days.into()); // Split year in half let mut first_half_commands: HashMap = HashMap::new(); let mut second_half_commands: HashMap = HashMap::new();