Problem/Motivation

Fullcalendar has a displayEventTime property which controls whether or not to display the text for an event’s date/time. Some sites may not want the times shown for any listings, but more importantly it would allow for additional options on how the times should be displayed.

Currently the times are rendered by Moment.js, but as identified in #3228517: Timezones and Fullcalendar View there isn't currently a way to pass in the timezone, which means that format strings which include a timezone indicator will only ever show the site/calendar value, even when a specific event is meant to be in a different timezone.

Also, the default formatting only shows the minutes when not on the hour, but when using a custom Moment.js format string, a site builder can only choose to display minutes always or never. If Fullcalendar View could be configured to suppress the default time render using displayEventTime, it would be possible to prepend the title display with time rendering from Smart Date, which can support custom strings as well as the ability to only show minutes on the hour, as well as the correct timezone for the event. This could be accomplished using the capability to define custom strings that is already built into Views.

Remaining tasks

Add a configuration option to the display. If set, pass the value to Fullcalendar.

User interface changes

Add a configuration option.

Data model changes

Add the new option to the configuration schema.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mandclu created an issue. See original summary.

mandclu’s picture

Issue summary: View changes
karing’s picture

Hi @mandlu -> I discussed this with my team and one of our dev pointed out that this is actually already possible.

In Settings -> change the Time Format settings -> to
[ ]

Then you can make Title anything you want -> in this example -> my Title is field Smart Date -> and this is my Smart Date Format (which includes Timezone) ->

FCV

FCV

karing’s picture

mandclu’s picture

StatusFileSize
new26.84 KB

This is exciting news! I can confirm this works also:

That said, I expect there is still some wasted front end overhead, since Moment.js is likely still looping over every row and trying to generate a time label. I would personally still be in favour of having an explicit checkbox, also because it makes for a better site building experience.

karing’s picture

@mandlu - agreed, this is not efficient. But it's a safe way to gain full control over the label and that solves the immediate problem.

I think we have two steps:

1. [now] - add set to [ ] + explain in the help/description in the Settings screen - main goal: get full control over the labels
2. [ToDo] - provide an option on the Settings screen to take Moment.js out the equation - main goal: better performance

I'm going to work on 1 right now.

karing’s picture

StatusFileSize
new198.17 KB

PS - of course if one wants to do so - you can now also completely remove anything with Time from the label ->

FCV

karing’s picture

karing’s picture

@mandlcu and @minsong -> does the wording look ok to you?

karing’s picture

Status: Active » Needs review

Mingsong made their first commit to this issue’s fork.

  • Mingsong committed e3af65c on 5.x authored by KarinG
    Issue #3260799 by KarinG, mandclu: Allow configuration for...
mingsong’s picture

Status: Needs review » Fixed

Looks good to me.
Thank you.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.