Skip to content

Commit

Permalink
fix use of deprecated method
Browse files Browse the repository at this point in the history
  • Loading branch information
edouardparis committed Apr 2, 2024
1 parent bd9374e commit a512177
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion gui/src/app/state/settings/bitcoind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ impl RescanSetting {
u32::from_str(&self.day.value).unwrap_or(1),
)
.and_then(|d| d.and_hms_opt(0, 0, 0))
.map(|d| d.timestamp())
.map(|d| d.and_utc().timestamp())
{
match cache.network {
Network::Bitcoin => {
Expand Down
8 changes: 4 additions & 4 deletions gui/src/app/view/home.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use chrono::NaiveDateTime;
use chrono::DateTime;
use std::collections::HashMap;

use iced::{alignment, widget::Space, Alignment, Length};
Expand Down Expand Up @@ -172,7 +172,7 @@ fn event_list_view(i: usize, event: &HistoryTransaction) -> Column<'_, Message>
} else if let Some(t) = event.time {
col.push(event::confirmed_incoming_event(
label,
NaiveDateTime::from_timestamp_opt(t as i64, 0).unwrap(),
DateTime::from_timestamp(t as i64, 0).unwrap(),
&output.value,
Message::SelectSub(i, output_index),
))
Expand All @@ -188,7 +188,7 @@ fn event_list_view(i: usize, event: &HistoryTransaction) -> Column<'_, Message>
} else if let Some(t) = event.time {
col.push(event::confirmed_outgoing_event(
label,
NaiveDateTime::from_timestamp_opt(t as i64, 0).unwrap(),
DateTime::from_timestamp(t as i64, 0).unwrap(),
&output.value,
Message::SelectSub(i, output_index),
))
Expand Down Expand Up @@ -286,7 +286,7 @@ pub fn payment_view<'a>(
.push(card::simple(
Column::new()
.push_maybe(tx.time.map(|t| {
let date = NaiveDateTime::from_timestamp_opt(t as i64, 0)
let date = DateTime::from_timestamp(t as i64, 0)
.unwrap()
.format("%b. %d, %Y - %T");
Row::new()
Expand Down
6 changes: 3 additions & 3 deletions gui/src/app/view/transactions.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use chrono::NaiveDateTime;
use chrono::DateTime;
use std::collections::{HashMap, HashSet};

use iced::{alignment, widget::tooltip, Alignment, Length};
Expand Down Expand Up @@ -107,7 +107,7 @@ fn tx_list_view(i: usize, tx: &HistoryTransaction) -> Element<'_, Message> {
Container::new(
text(format!(
"{}",
NaiveDateTime::from_timestamp_opt(t as i64, 0)
DateTime::from_timestamp(t as i64, 0)
.unwrap()
.format("%b. %d, %Y - %T"),
))
Expand Down Expand Up @@ -374,7 +374,7 @@ pub fn tx_view<'a>(
.push(card::simple(
Column::new()
.push_maybe(tx.time.map(|t| {
let date = NaiveDateTime::from_timestamp_opt(t as i64, 0)
let date = DateTime::from_timestamp(t as i64, 0)
.unwrap()
.format("%b. %d, %Y - %T");
Row::new()
Expand Down
4 changes: 2 additions & 2 deletions gui/ui/src/component/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub fn unconfirmed_outgoing_event<'a, T: Clone + 'a>(

pub fn confirmed_outgoing_event<'a, T: Clone + 'a>(
label: Option<Text<'a>>,
date: chrono::NaiveDateTime,
date: chrono::DateTime<chrono::Utc>,
amount: &Amount,
msg: T,
) -> Container<'a, T> {
Expand Down Expand Up @@ -99,7 +99,7 @@ pub fn unconfirmed_incoming_event<'a, T: Clone + 'a>(

pub fn confirmed_incoming_event<'a, T: Clone + 'a>(
label: Option<Text<'a>>,
date: chrono::NaiveDateTime,
date: chrono::DateTime<chrono::Utc>,
amount: &Amount,
msg: T,
) -> Container<'a, T> {
Expand Down

0 comments on commit a512177

Please sign in to comment.