mirror of
https://github.com/gitui-org/gitui
synced 2026-05-23 08:58:21 +00:00
fix warnings
This commit is contained in:
parent
ecb793206d
commit
5808515853
2 changed files with 13 additions and 9 deletions
|
|
@ -31,10 +31,12 @@ impl From<CommitInfo> for LogEntry {
|
|||
if date.is_none() {
|
||||
log::error!("error reading commit date: {hash_short} - timestamp: {}",c.time);
|
||||
}
|
||||
DateTime::<Local>::from(DateTime::<Utc>::from_utc(
|
||||
date.unwrap_or_default(),
|
||||
Utc,
|
||||
))
|
||||
DateTime::<Local>::from(
|
||||
DateTime::<Utc>::from_naive_utc_and_offset(
|
||||
date.unwrap_or_default(),
|
||||
Utc,
|
||||
),
|
||||
)
|
||||
};
|
||||
|
||||
let author = c.author;
|
||||
|
|
|
|||
|
|
@ -28,11 +28,13 @@ macro_rules! try_or_popup {
|
|||
|
||||
/// helper func to convert unix time since epoch to formated time string in local timezone
|
||||
pub fn time_to_string(secs: i64, short: bool) -> String {
|
||||
let time = DateTime::<Local>::from(DateTime::<Utc>::from_utc(
|
||||
NaiveDateTime::from_timestamp_opt(secs, 0)
|
||||
.unwrap_or_default(),
|
||||
Utc,
|
||||
));
|
||||
let time = DateTime::<Local>::from(
|
||||
DateTime::<Utc>::from_naive_utc_and_offset(
|
||||
NaiveDateTime::from_timestamp_opt(secs, 0)
|
||||
.unwrap_or_default(),
|
||||
Utc,
|
||||
),
|
||||
);
|
||||
|
||||
time.format(if short {
|
||||
"%Y-%m-%d"
|
||||
|
|
|
|||
Loading…
Reference in a new issue