;; SPDX-FileCopyrightText: Copyright (C) 2011-2024 Free Software Foundation, Inc. ;; SPDX-FileCopyrightText: Copyright (C) 2025 Lukas Epple ;; SPDX-License-Identifier: GPL-3.0-or-later (require 'org) (require 'ox-html) (defconst le-org-html-timestamp-formats '("%F" . "%FT%T%z")) (defun le-org-html-format-timestamp (timestamp info) (let* ((tag (if (org-html-html5-p info) "time" "span")) (html5-format (funcall (if (org-timestamp-has-time-p timestamp) #'car #'cdr) le-org-html-timestamp-formats)) (attrs (append '("class=\"timestamp\"") (when (org-html-html5-p info) (list (format "datetime=\"%s\"" (org-format-timestamp timestamp html5-format)))))) (display-value (org-html-plain-text (org-timestamp-translate timestamp) info))) (format "<%s %s>%s" tag (mapconcat #'identity attrs " ") (replace-regexp-in-string "--" "𠈓" display-value) tag))) (defun le-org-html-timestamp (timestamp _contents info) (format "%s" (le-org-html-format-timestamp timestamp info))) (advice-add 'org-html-timestamp :override #'le-org-html-timestamp) (provide 'le-org-html5-timestamps)