开发者

Change title of event from 'start time - end time' to 'start datetime - end datetime' when event spans multiple days

When an event in Full Calendar starts at 8:00 and ends at 16:00, that's exactly what it shows in the title in the week view: '8:00 - 16:00'.

But, when the event starts today at 8:00 and ends the day after tomorrow at 16:00, it also show开发者_StackOverflows '8:00 - 16:00' in the title.

I know I can change the format of the title by using:

    timeFormat: 'd-M H:mm{ - d-M H:mm}'

But what I would really like, is that the date is only showed when the event spans multiple days.

So:

If the event is a one-day event:

    timeFormat: 'H:mm{ - H:mm}'

If the event is a multiple-day event:

    timeFormat: 'd-M H:mm{ - d-M H:mm}'

Is this possible?

Thanks in advance.


This question is quite old, but I'll answer it for future reference.

You should use this format:

timeFormat: '[d-M ]H:mm{ -[ d-M] H:mm}'
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜