question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Calendar module enhancement: displaying full day events without time

See original GitHub issue

With relative timeformat, upcoming full day events are displayed like this:

Wednesday at 12:00 AM

which doesn’t make much sense to me. I’ve tried to look into the documentation and the code, and it seems like there’s no way to configure it at the moment.

calendar() method from moments.js used in the relative time display can’t format without time by default, but does allow using custom calendar formatters. They are a rather tricky, because due to different localizations one size won’t fit all, but I believe I’ve nailed it by putting adapted locale-specific calendars into translation files.

Would you consider adding it to the main repository? The details of the change can be found here. I’ve updated translation files for the languages I know, but others require at least minimal understanding of grammar, so I don’t think I can’t do it myself. Also, for configuring the calendar from translation files, I’m using coreTranslations directly because in this case I don’t want the fallback to English version, but rather to default localized calendar from moments.js.

I am also thinking about using dateFormat from config to replace the default "sameElse": "L", allowing customization in relative format too, what do you think of it?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
khasselcommented, Oct 3, 2022

seems to be fixed with the above PR’s, so should be closed @uncleLem @MichMich

1reaction
uncleLemcommented, Jan 27, 2021

The calendar module is widely used and backward compatibility is important. One could change default behavior but a user should be able to “restore” behavior by setting options.

@Alvinger calendar.js:382 - in current implementation it falls back to default .calendar() method if there’s no custom calendar available. I can add a config parameter to enforce it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Default calendar module: displaying full day events without time
Hi all, I'm playing with my first Magic Mirror installation and there's one thing that bugs me in the default calendar module: an...
Read more >
All You Need to Know about a FullCalendar View Module
The next step is to create views with the Full Calendar Display format: ... events, add confirmation popups, and set limits for one...
Read more >
Smart Date | Drupal.org
This module brings that same capability to Drupal. Zero Duration Events Show only a single time for events that don't need a duration....
Read more >
Work Smarter in Calendar and Events - Trailhead - Salesforce
Lance creates an object calendar to show the dates of all his upcoming ... list views to see more events listed in one...
Read more >
Schedule calendar - Product Documentation | ServiceNow
Show as, Status that is visible when the event starts. ; When, Date and time when the event starts and ends. ; All...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found