Calendar widget. Disable End time

  • 1
  • Question
  • Updated 4 years ago
  • Answered
With the new Calendar widget, how do I hide the end time for an event?

We only want to show the start time.

Thanks!
Photo of Eric S.

Eric S.

  • 7,412 Points 5k badge 2x thumb

Posted 4 years ago

  • 1
Photo of Joshua Jacobs

Joshua Jacobs

  • 130 Points 100 badge 2x thumb
I'm looking for this feature also. Haven't figured it out yet.
Photo of Eric S.

Eric S.

  • 7,412 Points 5k badge 2x thumb
Have you figured out how to host your custom layout files?
Photo of Donna Peplinskie

Donna Peplinskie

  • 7,142 Points 5k badge 2x thumb
In the `src/widget/event.js` file there's this code (should be around line 21):
$day.find(".time").eq(pos).text(moment(event.start.dateTime).format(timeFormat) + " - " + moment(event.end.dateTime).format(timeFormat));
This is where the time gets populated. If you only want to show the start time, then you can remove the end time:
$day.find(".time").eq(pos).text(moment(event.start.dateTime).format(timeFormat));
Then run `gulp build` and host all of the files in the `dist` folder on a server.

Thx.
Photo of Eric S.

Eric S.

  • 7,412 Points 5k badge 2x thumb
Thanks Donna,
Going to try and get the Dev environment setup today if I have time.
Photo of Eric S.

Eric S.

  • 7,412 Points 5k badge 2x thumb
Worked like a charm, thanks!