EpisodeWidget: Trim date label to avoid date/title miss alignment on single digit dates.

This commit is contained in:
Jordan Petridis 2018-01-05 18:46:22 +02:00
parent 65a2d666a3
commit d8d4b08252
No known key found for this signature in database
GPG Key ID: CEABAD9F5683B9A6

View File

@ -151,9 +151,10 @@ impl EpisodeWidget {
let now = Utc::now();
let date = Utc.timestamp(i64::from(epoch), 0);
if now.year() == date.year() {
self.date.set_text(&date.format("%e %b").to_string());
self.date.set_text(&date.format("%e %b").to_string().trim());
} else {
self.date.set_text(&date.format("%e %b %Y").to_string());
self.date
.set_text(&date.format("%e %b %Y").to_string().trim());
};
}