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.
Date to format (Date object or ISO date 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" Copy
// 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"
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.