markdown element for datetime with automatic timezone conversions
Requirements
- [X] This is a feature request and not a bug report. Otherwise, please create a new bug report instead.
- [X] Please check to see if this request (or a similar one) already exists.
- [X] It's a single feature. Please don't request multiple features in one issue.
Describe the feature you'd like
Currently I don't think there's any way to share datetimes with people without having to worry about timezone conversions. The best you can do is like "24 hours from this post"
would need to be something that renders decently even on clients that don't support it yet
Do you have a suggestion for the syntax, or an example of a Markdown flavor that already does it?
Do you have a suggestion for the syntax, or an example of a Markdown flavor that already does it?
Discord is markdown and that does it like this
<t:1718557464:F>
https://sesh.fyi/timestamp/
Not a bad idea, although it should be integrated into a date / time picker helper.
Another implementation of this is the one used by Zulip, which is also formatted with Markdown:
Our next meeting is scheduled for <time:2024-08-06T17:00:00+01:00>.You can also use other formats such as UNIX timestamps or human readable dates, for example,
<time:August 06 2024, 5:00 PM BST>.
https://zulip.com/help/global-times
Here's a list of test cases used by Zulip which shows the variety of supported datestamp formats: https://github.com/zulip/zulip/blob/eadc9a85306018c12355bf152d98ace3c0d1964f/zerver/tests/fixtures/markdown_test_cases.json#L807-L867
EDIT: Zulip uses their own in-repo fork of Marked with custom <time:> tag:
https://github.com/zulip/zulip/tree/eadc9a85306018c12355bf152d98ace3c0d1964f/web/third/marked/lib
It'd be best if someone could make this a markdown-it plugin.
Can re-open if someone wants to take this on.