sparkle
sparkle copied to clipboard
[EventModal] Display event start time not just the date
ATM

(markdown issue filed separately: #1505 )
So if the event has time -- it should be displayed, as "Starts at HH:MM on MM/DD/YY in PLACE"
fancy one would be : if starts on the same day or let's say in 24h to be kind to midnight people, display "Starts in MM minutes at HH:MM in PLACE" (I think it is ok to skip the date in such case ;-)) or even switch to ticking clock with minutes/seconds counting down -- it is React after all, right? ;)
well, I think it is due to use of the
* @see https://date-fns.org/docs/formatRelative
*/
export const formatUtcSecondsRelativeToNow = (utcSeconds: number) =>
formatRelative(fromUnixTime(utcSeconds), Date.now());
so according to https://date-fns.org/docs/formatRelative, whenever distance would be shorter than 6 days, we will start to see time .
I think it is suboptimal a little (ideally time should be displayed regardless of the distance for the conference since event is not a multi-day one) so people could see the date and time to plan. But I do not see an easy solution (e.g. some option to formatRelative).
See the changes I made to utils/time in https://github.com/sparkletown/sparkle/pull/1538, most notably formatDateRelativeToNow:
- https://github.com/sparkletown/sparkle/blob/staging/src/utils/time.ts#L146-L189
It's not an exact fix for this issue, but it lays basically all of the boilerplate/groundwork for it.
@yarikoptic Based on your screenshot I assume the intent of this issue is for it to be shown within the EventModal that is visible when clicking on an event in the schedule/etc?