EpisodeWidget: Change date representation based on it's year. Closes #19.
This commit is contained in:
parent
4a033e6d89
commit
b7e160f735
@ -124,10 +124,13 @@ impl EpisodeWidget {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let date = Utc.timestamp(i64::from(episode.epoch()), 0)
|
let now = Utc::now();
|
||||||
.format("%b %e")
|
let date = Utc.timestamp(i64::from(episode.epoch()), 0);
|
||||||
.to_string();
|
if now.year() == date.year() {
|
||||||
self.date.set_text(&date);
|
self.date.set_text(&date.format("%e %b").to_string());
|
||||||
|
} else {
|
||||||
|
self.date.set_text(&date.format("%e %b %Y").to_string());
|
||||||
|
};
|
||||||
|
|
||||||
// Show or hide the play/delete/download buttons upon widget initialization.
|
// Show or hide the play/delete/download buttons upon widget initialization.
|
||||||
let local_uri = episode.local_uri();
|
let local_uri = episode.local_uri();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user