Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Control over how multi-day timed events rendering their time text #3038

Open
flack opened this issue Feb 8, 2016 · 9 comments
Open

Control over how multi-day timed events rendering their time text #3038

flack opened this issue Feb 8, 2016 · 9 comments

Comments

@flack
Copy link
Contributor

flack commented Feb 8, 2016

Steps to reproduce:

1: go to http://fullcalendar.io/js/fullcalendar-2.6.0/demos/selectable.html
2: go to week view
3: select a timespan from Monday to Tuesday

Expected result:

  • selected end time is shown on fc-event-helper

Actual result:

  • 12:00 is shown, no matter when the event actually ends

Screenshot:

wrong_end_time

@arshaw
Copy link
Member

arshaw commented Feb 10, 2016

this was intentional behavior for events that span across the nextDayThreshold. If you scroll up you'll see the event on Monday continue from midnight to 9am on Tuesday.

If there is enough demand, we could potentially introduce a setting for fine-grain control of this behavior.

@flack
Copy link
Contributor Author

flack commented Feb 10, 2016

hmm, ok, but if it's intentional, then why do I get a different end time in event.end when the eventDrop callback runs? In the screenshot above, event.end will be 9:00 AM, it's only the displayed value on the helper that says 12:00

@arshaw arshaw changed the title Wrong end time when resizing an event to the next day Control over how multi-day timed events rendering their time text Feb 21, 2016
@arshaw
Copy link
Member

arshaw commented Feb 21, 2016

this issue concerns itself with how an event's text is displayed. concerned with what text renders on each event segment when it spans across two days. It's merely what text is displayed. the underlying data, the event.end should be as expected.

@ghost
Copy link

ghost commented Jul 22, 2019

I, too, would like this functionality. It would be nice to have the option of whether to show the splits or the actual event time on both segments.

@jayatulsiani
Copy link

yes i would like this functionality to be implemented. can it be done using range option? i tried using range but in vain. can somebody help me here

@bartvdklu
Copy link

It would be nice to have this functionality! Hope it gets implemented. 👍

@blissdev
Copy link
Contributor

This would be very useful for my team's usage.

@ekrismer
Copy link

ekrismer commented Feb 15, 2023

I've found at least four locations that are affected by this issue.

Have a look at this Codepen: https://codepen.io/erabl/pen/GRXgNVm

  1. Multiday events that exceed the current view's date range, but start/end within
    grafik

  2. Multiday events that start before and end after the current view's date range
    grafik

  3. Multiday events that are part of a '+ more' popover
    grafik

  4. Multiday events in a timeGrid
    grafik

I was able to find a workaround to show the actual start/end time of the events for v5.11.0 (Codepen) using

eventContent: (arg) => {
  if (arg.event.start && arg.event.end) {
    // this is just a quick hack: use a proper date formatter with timezone!
    arg.timeText = `${arg.event.start.toISOString().slice(11,16)} - ${arg.event.end.toISOString().slice(11,16)}`;
  }
}

but could not get this to work with v6.1.4.

@arshaw, @acerix do you know a workaround that is compatible with v6?

Are there any plans to add a flag that controls how multiday event times are rendered?

Possibly related issues: #6936, #3765, #5826.

@ekrismer
Copy link

ekrismer commented Mar 20, 2023

I figured out a workaround for v6.1.0: Content Injection now requires to return true to render the default content (see #7110 and https://fullcalendar.io/docs/upgrading-from-v5#content-injection).

eventContent: (arg) => {
  if (arg.event.start && arg.event.end) {
    // this is just a quick hack: use a proper date formatter with timezone!
    arg.timeText = `${arg.event.start.toISOString().slice(11,16)} - ${arg.event.end.toISOString().slice(11,16)}`;
  }
  return true; // render default content
}

This hint unfortunately is not mentioned in the regular documentation: https://fullcalendar.io/docs/content-injection

@acerix acerix mentioned this issue Jul 21, 2023
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants