propertiesView: Use local datetime
Closes #130 Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/166>
This commit is contained in:
parent
e8aa5451c3
commit
3264d7813d
1 changed files with 6 additions and 1 deletions
|
|
@ -17,7 +17,12 @@ pub fn datetime_fmt(datetime: &glib::DateTime) -> Option<String> {
|
|||
// The default is already translated. Don't change if you are not sure what to use.
|
||||
let datetime_format = gettext("%x %X");
|
||||
|
||||
let fmt = datetime.format(&datetime_format);
|
||||
let local_datetime = datetime.to_local();
|
||||
|
||||
let fmt = local_datetime
|
||||
.as_ref()
|
||||
.unwrap_or(datetime)
|
||||
.format(&datetime_format);
|
||||
|
||||
if let Err(err) = &fmt {
|
||||
log::error!("Could not format DateTime with '{datetime_format}': {err}");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue