From d0c58b24538e0ab3ceeb7c08fa42f49549ba2791 Mon Sep 17 00:00:00 2001 From: Yonas Date: Mon, 16 Sep 2024 18:17:36 -0400 Subject: [PATCH] Fix outdated chrono warning. --- src/widget/options.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/widget/options.rs b/src/widget/options.rs index ea10c5d..373e175 100644 --- a/src/widget/options.rs +++ b/src/widget/options.rs @@ -1,7 +1,7 @@ use std::collections::HashMap; use std::hash::{Hash, Hasher}; -use chrono::NaiveDateTime; +use chrono::DateTime; use tui::buffer::Buffer; use tui::layout::{Alignment, Constraint, Direction, Layout, Rect}; use tui::style::Modifier; @@ -328,7 +328,7 @@ impl CachableWidget for OptionsWidget { .exp_dates .iter() .map(|d| { - let date = NaiveDateTime::from_timestamp_opt(*d, 0).unwrap().date(); + let date = DateTime::from_timestamp(*d, 0).unwrap().date_naive(); ListItem::new(Span::styled(date.format("%b-%d-%y").to_string(), style())) }) .collect::>();