- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 55
Open
Labels
enhancementNew feature or requestNew feature or request
Description
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";
const date = (date: Date) => {
  const datetime = DateTime.fromJSDate(date);
  const unixTimestamp = datetime.toFormat("X");
  const fallback = 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!
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request