Add header to multiyear groups.

E.g. "2018 - 20" or "1989 - 2003".
This commit is contained in:
Rasmus Kaj 2020-09-06 00:03:01 +02:00
parent 8cedcd8ce9
commit 2f251bf8e2

View File

@ -64,8 +64,14 @@ impl PhotoLink {
)
}
} else {
let (from_year, to_year) = (from.year(), to.year());
let to_year = if from_year / 100 == to_year / 100 {
to_year % 100
} else {
to_year
};
(
None,
Some(format!("{} - {}", from_year, to_year)),
format!(
"{} - {} ({})",
from.format("%F"),