diff --git a/web/_js/infoblock.js b/web/_js/infoblock.js index 87c290a5..b41afeb3 100644 --- a/web/_js/infoblock.js +++ b/web/_js/infoblock.js @@ -43,7 +43,7 @@ function createInfoBlock(entry, isPreview) { else { let targetPeriod = formatPeriod(currentPeriod, currentPeriod, currentVariation) linkElement.href = "#" + entry.id - if (targetPeriod) linkElement.href += "/" + targetPeriod + if (targetPeriod && targetPeriod != defaultPeriod) linkElement.href += "/" + targetPeriod }; const linkNameElement = document.createElement("span"); linkNameElement.className = "flex-grow-1 text-break"; diff --git a/web/_js/time.js b/web/_js/time.js index 98a19cf1..1450b193 100644 --- a/web/_js/time.js +++ b/web/_js/time.js @@ -263,12 +263,16 @@ function parsePeriod(periodString) { } function formatPeriod(start, end, variation) { - let periodString + let periodString, variationString + variationString = variationsConfig[variation].code if (start === end) { - if (start === variationsConfig[variation].default) periodString = "" + if (start === variationsConfig[variation].default && variation !== defaultVariation) { + periodString = "" + } else periodString = start } else periodString = start + "-" + end - if (variation !== "default") return variationsConfig[variation].code + ":" + periodString + if (periodString && variationString) return variationsConfig[variation].code + ":" + periodString + if (variationString) return variationString return periodString } \ No newline at end of file