Hiyve Components - v1.0.0
    Preparing search index...
    • Format an upcoming date as a friendly relative day + time, with calendar-day boundaries (NOT rolling 24-hour windows) in the user's local timezone.

      Parameters

      • date: string | Date

        Date to format (Date object or ISO date string)

      Returns string

      Formatted string, or empty string for invalid input

      // assume "now" is Mon 2:00 PM
      formatUpcomingTime(monAt11pm) // "Today 11:00 PM"
      formatUpcomingTime(tueAt1am) // "Tomorrow 1:00 AM" — not "Today"
      formatUpcomingTime(wedAt4pm) // "Wed 4:00 PM"
      formatUpcomingTime(in10Days) // "Mar 12 10:00 AM"