Skip to content
15 changes: 14 additions & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,20 @@
# (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 formatTimestamp() {
document.querySelectorAll("time.localized").forEach(el => {
const d = new Date(el.getAttribute("datetime"));
const locale = Intl.DateTimeFormat().resolvedOptions().locale;
el.textContent = d.toLocaleString(locale);
});
}
if (document.readyState !== "loading") {
formatTimestamp();
} else {
document.addEventListener("DOMContentLoaded", formatTimestamp);
}
</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