propertiesView: Unify localized DateTime format

Closes #43

Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/141>
This commit is contained in:
Sophie Herold 2023-03-14 02:27:31 +01:00 • committed by Marge Bot
parent b8d5f833f3
commit e93020d9ab
3 changed files with 20 additions and 8 deletions

View file

@ -10,6 +10,7 @@ pub use gps::GPSLocation;
pub use obj::LpImageMetadata;
use crate::i18n::*;
use crate::util;
use gtk::glib;
@ -95,10 +96,7 @@ impl ImageMetadata {
dt.minute.into(),
dt.second.into(),
) {
// Translators: Date (%x) and time (%X) combined
if let Ok(formatted) = datetime.format(&i18n("%x %X")) {
return Some(formatted.to_string());
}
return util::datetime_fmt(&datetime);
}
}
}