Skip to content

Show time today#2890

Merged
MichMich merged 3 commits intoMagicMirrorOrg:developfrom
MikeBishop:showTimeToday
Jul 28, 2022
Merged

Show time today#2890
MichMich merged 3 commits intoMagicMirrorOrg:developfrom
MikeBishop:showTimeToday

Conversation

@MikeBishop
Copy link
Contributor

When I was trying to move to the "relative" timeFormat, I found that while relative was useful for events that were approaching -- the baseball game is on Saturday, etc. -- present-day events in relative format were at best annoying.

This adds an additional option that displays non-full-day events with an absolute time on the current day, while leaving the relative behavior alone for other days. (Full-day events continue to display "Today".)

@codecov-commenter
Copy link

codecov-commenter commented Jul 25, 2022

Codecov Report

Merging #2890 (3dc8261) into develop (2d15e4f) will not change coverage.
The diff coverage is n/a.

❗ Current head 3dc8261 differs from pull request most recent head be97611. Consider uploading reports for the commit be97611 to get more accurate results

@@           Coverage Diff            @@
##           develop    #2890   +/-   ##
========================================
  Coverage    63.82%   63.82%           
========================================
  Files            9        9           
  Lines          293      293           
========================================
  Hits           187      187           
  Misses         106      106           

Help us with your feedback. Take ten seconds to tell us how you rate us.

@khassel
Copy link
Collaborator

khassel commented Jul 25, 2022

the failed test (electron executable not found) seems unrelated to your changes (don't know what happened there on the github machine). You can trigger the tests again by pushing a new commit (e.g. by removing the line break in the changelog).

timeWrapper.innerHTML = this.capFirst(
moment(event.startDate, "x").calendar(null, {
sameDay: "[" + this.translate("TODAY") + "]",
sameDay: this.config.showTimeToday ? "LT" : "[" + this.translate("TODAY") + "]",
Copy link
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?

Copy link
Contributor Author

@MikeBishop MikeBishop Jul 27, 2022

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.

@MichMich MichMich merged commit d24fe4e into MagicMirrorOrg:develop Jul 28, 2022
@MichMich
Copy link
Collaborator

Awesome! Would you mind adding info about this feature via a PR on: https://github.com/MichMich/MagicMirror-Documentation

Thanks! :)

MikeBishop added a commit to MikeBishop/MagicMirror-Documentation that referenced this pull request Jul 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants