vkurko / calendar

Full-sized drag & drop JavaScript event calendar with resource & timeline views
https://vkurko.github.io/calendar/
MIT License
1.23k stars 108 forks source link

eventTimeFormat: Take range as an input rather than individual time? #149

Closed meisemann1999 closed 1 year ago

meisemann1999 commented 1 year ago

As of now, it seems that this function takes in a single parameter and runs twice for each event (once for start and once for end). Would it be possible to have a variation of this function that takes the range (start and end time), which would allow for using something like Intl.DateTimeFormat.formatRange to create the date? I am thinking of a scenario in which the event time could be displayed on the calendar as, for example, "5:00 - 5:30 PM" rather than "5:00 PM - 5:30 PM". This is a little more concise and could save some space on smaller screen sizes,

vkurko commented 1 year ago

This is a good idea. I'll think about how I can add such a setting. In the meantime, you can use eventContent to have full control over the rendering of events and display the time yourself as needed.

vkurko commented 1 year ago

In v2.0.0 the eventTimeFormat now receives 2 parameters for the time span to be formatted. Please check.

vkurko commented 1 year ago

I hope I can close this issue.