Template talk:Timeline-event
Add topic| This template does not require a rating on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | ||||||||
| ||||||||
Problem
[edit]| This help request has been answered. If you need more help, you can , contact the responding user(s) directly on their user talk page, or consider visiting the Teahouse. |
When |end_date= is used together with |date=, the template appears like so:
- April 21, 2012 – November 18, 2012: Another thing happened
Is there any way one can code the template, so that a space appears both before and after the en dash for full dates only? So that if a year is inputted like so...
- 2012–2013: Another thing happened
... There is no space before and after the dash. I tried copying Izkala's edit here with this edit, which I thought worked. But if one were to use |date= on its own...
{{Timeline-event |date={{Start date|2012|04|21}} |event= Something happened}}
... It appears like so:
- April 21, 2012 – {{{end_date}}}: Something happened
I am not quite sure how to solve this.--Nevé–selbert 22:47, 9 September 2017 (UTC)
- The issue is that the
{{#if:{{#invoke:String...is it's own if statement. In Izkala's diff you gave above,{{{end}}}was always used. Thus, I just added in an extra #if statement around the whole thing to check if|end_date=existed. Primefac (talk) 23:13, 9 September 2017 (UTC)
Unspaced dash
[edit]I don't quite understand the remarks above about an unspaced en dash for years only.
"{{Timeline-event|date={{Start date|1887}}|end_date={{End date|1888}}|location=Leipzig}}" produces
"1887–1888: Leipzig". That en dash ought to be unspaced. -- Michael Bednarek (talk) 15:23, 11 February 2020 (UTC)
Fixed There was code to check whether both |date=and|end_date=were both just years, and if so to use an unspaced en dash, but it didn't work with {{Start date}} and {{End date}} (which the documentation requires). This was because it assumed that year-only dates wouldn't contain any spaces, but these templates also emit hidden spans that contain spaces. I've changed it to look for the pattern [letter][non-breaking space][number], as year-only dates don't have that, while all {{Start date}} and {{End date}} dates that are more than just a year always do (the month name followed either by the year, or the day). --YodinT 16:48, 21 August 2026 (UTC)
Optionally hide some values
[edit]May want a switch to hide all but the |event= parameter value, esp as many editors prefer/in some contexts we need timelines in tabular form, or in structured lists (eg years as hd1, months as hd2, etc). Would allow us to have timeline metadata while still presenting timelines to readers in the most useful/preferred style for the given context. - Asdfjrjjj (talk) 07:18, 13 August 2026 (UTC)