Skip to content

API Reference

BleckWolf edited this page May 10, 2025 · 1 revision

formatDate(date: Date, options?: FormatOptions): string

  • Parameters:
    • date: The date to format.
    • options (optional): Formatting options.
  • Returns:
    • A human-friendly formatted date string.
  • FormatOptions Interface:
    • locale (string): Locale code, e.g., 'en-US'.
    • relative (boolean): Whether to use relative formatting.
    • timeFormat ('12h' | '24h'): Time format preference.

Thanks for choosing friendly-dates!

Package made by: Dynamic Innovative Studio

For the community, by the community, with the community.

Clone this wiki locally