mirror of
https://github.com/chirpstack/chirpstack.git
synced 2025-05-05 10:33:08 +00:00
Remove usage of deprecated date() method.
As the date_naive() method (recommended replacement for date()) does not contain tz information, we need to add it back using and_local_timezone().
This commit is contained in:
parent
5953542a72
commit
8d34bb0d0c
@ -232,16 +232,20 @@ pub async fn get(
|
|||||||
// than 24h and we end up with the same day. Therefore we increment by two
|
// than 24h and we end up with the same day. Therefore we increment by two
|
||||||
// days.
|
// days.
|
||||||
(ts + ChronoDuration::days(2))
|
(ts + ChronoDuration::days(2))
|
||||||
.date()
|
.date_naive()
|
||||||
.and_hms_opt(0, 0, 0)
|
.and_hms_opt(0, 0, 0)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
|
.and_local_timezone(Local)
|
||||||
|
.unwrap()
|
||||||
} else {
|
} else {
|
||||||
// Make sure that the timestamp stays at midnight in case of non-DST to DST
|
// Make sure that the timestamp stays at midnight in case of non-DST to DST
|
||||||
// change.
|
// change.
|
||||||
(ts + ChronoDuration::days(1))
|
(ts + ChronoDuration::days(1))
|
||||||
.date()
|
.date_naive()
|
||||||
.and_hms_opt(0, 0, 0)
|
.and_hms_opt(0, 0, 0)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
|
.and_local_timezone(Local)
|
||||||
|
.unwrap()
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user