diff options
Diffstat (limited to 'resources')
| -rw-r--r-- | resources/pug/finals/publications.pug | 12 | 
1 files changed, 11 insertions, 1 deletions
| diff --git a/resources/pug/finals/publications.pug b/resources/pug/finals/publications.pug index 2de2fc1..d35fe08 100644 --- a/resources/pug/finals/publications.pug +++ b/resources/pug/finals/publications.pug @@ -123,7 +123,17 @@ block content  					staticScale: 25,  				},  				tooltip: { -					xDateFormat: '%Y-%m-%d', +					pointFormatter: function () { +						const start = this.series.chart.time.dateFormat('%Y-%m-%d', this.start); + +						if (!this.end) { /* milestone */ +							return `<b>${this.name}</b> on ${start}`; +						} + +						const days = Math.floor((this.end - this.start) / 1000 / 60 / 60 / 24); +						const end = this.series.chart.time.dateFormat('%Y-%m-%d', this.end); +						return `In <b>${this.name}</b> for ${days} days; ${start}–${end}`; +					},  				},  				series,  			}); | 
