sparkle icon indicating copy to clipboard operation
sparkle copied to clipboard

[EventModal] Display event start time not just the date

Open yarikoptic opened this issue 4 years ago • 3 comments

ATM

image

(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? ;)

yarikoptic avatar Jun 04 '21 19:06 yarikoptic

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).

yarikoptic avatar Jun 08 '21 01:06 yarikoptic

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.

0xdevalias avatar Jun 21 '21 05:06 0xdevalias

@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?

0xdevalias avatar Jun 21 '21 05:06 0xdevalias