Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ _This release is scheduled to be released on 2022-10-01._

## Added

- New `showTimeToday` option in calendar module shows time for current-day events even if `timeFormat` is `"relative"`

## Updated

## Fixed
Expand Down
3 changes: 2 additions & 1 deletion modules/default/calendar/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Module.register("calendar", {
hidePrivate: false,
hideOngoing: false,
hideTime: false,
showTimeToday: false,
colored: false,
coloredSymbolOnly: false,
customEvents: [], // Array of {keyword: "", symbol: "", color: ""} where Keyword is a regexp and symbol/color are to be applied for matched
Expand Down Expand Up @@ -368,7 +369,7 @@ Module.register("calendar", {
} else {
timeWrapper.innerHTML = this.capFirst(
moment(event.startDate, "x").calendar(null, {
sameDay: "[" + this.translate("TODAY") + "]",
sameDay: this.config.showTimeToday ? "LT" : "[" + this.translate("TODAY") + "]",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if this is set, it displays "LT"? How does that string show up on the MM?

@MikeBishop MikeBishop Jul 27, 2022

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It passes LT as the format string to Moment; compare the default value of dateEndFormat or other explicit uses here and here. LT renders time according to the current locale, e.g. "2:53 PM", "14:53", etc.

nextDay: "[" + this.translate("TOMORROW") + "]",
nextWeek: "dddd",
sameElse: event.fullDayEvent ? this.config.fullDayEventDateFormat : this.config.dateFormat
Expand Down