lemmy-ui icon indicating copy to clipboard operation
lemmy-ui copied to clipboard

markdown element for datetime with automatic timezone conversions

Open Die4Ever opened this issue 1 year ago • 5 comments

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

Die4Ever avatar May 29 '24 00:05 Die4Ever

Do you have a suggestion for the syntax, or an example of a Markdown flavor that already does it?

m-p-3 avatar Jun 16 '24 15:06 m-p-3

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/

Die4Ever avatar Jun 16 '24 17:06 Die4Ever

Not a bad idea, although it should be integrated into a date / time picker helper.

dessalines avatar Jun 17 '24 19:06 dessalines

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

vaguerant avatar Mar 15 '25 06:03 vaguerant

It'd be best if someone could make this a markdown-it plugin.

dessalines avatar Mar 15 '25 17:03 dessalines

Can re-open if someone wants to take this on.

dessalines avatar Jul 30 '25 12:07 dessalines