Jump to content

Template talk:Timeline-event

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Problem

[edit]

When |end_date= is used together with |date=, the template appears like so:

  • April 21, 2012 (2012-04-21) – November 18, 2012 (2012-11-18): 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)[reply]

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)[reply]

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 (1887) – 1888 (1888): Leipzig". That en dash ought to be unspaced. -- Michael Bednarek (talk) 15:23, 11 February 2020 (UTC)[reply]