Skip to content
21 changes: 20 additions & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,26 @@
# (Sphinx looks at variable changes and rewrites all files if some change)
copyright = ( # noqa: A001
f'2012–{td.year}, MNE Developers. Last updated <time datetime="{td.isoformat()}" class="localized">{td.strftime("%Y-%m-%d %H:%M %Z")}</time>\n' # noqa: E501
'<script type="text/javascript">function formatTimestamp() {document.querySelectorAll("time.localized").forEach(el => el.textContent = new Date(el.getAttribute("datetime")).toLocaleString([], {dateStyle: "medium", timeStyle: "long"}));};if (document.readyState != "loading") formatTimestamp();else document.addEventListener("DOMContentLoaded", formatTimestamp);</script>' # noqa: E501
"""<script type="text/javascript">
$(function () {
$("time.localized").each(function () {
var el = $(this);
var d = new Date(el.attr("datetime"));
var date = d.toLocaleDateString("sv-SE", {
year: "numeric",
month: "2-digit",
day: "2-digit"
});
var time = d.toLocaleTimeString([], {
hour: "2-digit",
minute: "2-digit",
hourCycle: "h23",
timeZoneName: "shortOffset"
});
el.text(`${date} ${time}`);
});
});
</script>"""
)
if os.getenv("MNE_FULL_DATE", "false").lower() != "true":
copyright = f"2012–{td.year}, MNE Developers. Last updated locally." # noqa: A001
Expand Down
Loading