Calendar module enhancement: displaying full day events without time
See original GitHub issueWith 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:
- Created 3 years ago
- Comments:10 (5 by maintainers)
seems to be fixed with the above PR’s, so should be closed @uncleLem @MichMich
@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.