You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I see that there are helpers for formatting Markdown, which is awesome! Wondering if you'd consider supporting Slack's advanced formatting, specifically Date formatting?
Describe the solution you'd like
I think exposing something like Md.date() would be useful to format dates.
Describe alternatives you've considered
I've implemented my own helper in my codebase, but it only exposes a narrow subset of the formatting options Slack allows:
import{DateTime}from"luxon";constdate=(date: Date)=>{constdatetime=DateTime.fromJSDate(date);constunixTimestamp=datetime.toFormat("X");constfallback=datetime.toFormat("MMMM d, yyyy 'at' h:mm a 'UTC'");return`<!date^${unixTimestamp}^{date} at {time}|${fallback}>`;};
Additional context
It may be costly to add a dependency for dealing with dates (Temporal API is Stage 3, but not adopted yet by any runtimes except Deno)
There's a lot of options for formatting the result and it might be challenging to explain to devs
On the plus side, these dates are timezone aware and will display information in a more robust way!
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
I see that there are helpers for formatting Markdown, which is awesome! Wondering if you'd consider supporting Slack's advanced formatting, specifically Date formatting?
Describe the solution you'd like
I think exposing something like
Md.date()
would be useful to format dates.Describe alternatives you've considered
I've implemented my own helper in my codebase, but it only exposes a narrow subset of the formatting options Slack allows:
Additional context
The text was updated successfully, but these errors were encountered: