mirror of
https://github.com/chirpstack/chirpstack.git
synced 2025-03-10 22:43:57 +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
|
||||
// days.
|
||||
(ts + ChronoDuration::days(2))
|
||||
.date()
|
||||
.date_naive()
|
||||
.and_hms_opt(0, 0, 0)
|
||||
.unwrap()
|
||||
.and_local_timezone(Local)
|
||||
.unwrap()
|
||||
} else {
|
||||
// Make sure that the timestamp stays at midnight in case of non-DST to DST
|
||||
// change.
|
||||
(ts + ChronoDuration::days(1))
|
||||
.date()
|
||||
.date_naive()
|
||||
.and_hms_opt(0, 0, 0)
|
||||
.unwrap()
|
||||
.and_local_timezone(Local)
|
||||
.unwrap()
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user