Hi,

Thank for this useful module.

I have the following issue on a website: The beginning date is not displayed (disappears) when I do not set an end date.

I use the compact / Medium format, for which I attached the configuration panel and the example panel that seems to work.

Did anyone get this issue. Any tip or track to follow may help me.

thanks in advance.

Comments

chipway created an issue. See original summary.

chipway’s picture

configuration panel

Issue_beginning-date-not-displayed-when-empty-end-date

and the example panel that seems to work

Issue_beginning-date-not-displayed-when-empty-end-date_examples

birk’s picture

I assume you're using the daterange_compactr module, to set the range formats?

If so do you get any error messages?
My guess is the module doesn't check for missing end dates (since it's not a standard part of core). So when the end date is missing, something goes wrong.

I don't know your usecase - and I don't know if it works with empty end dates - but there's a nother range foramtter module: https://www.drupal.org/project/date_range_formatter perhaps it works. (Or maybe the date extra module has something).

Let me know if any of the other modules work, if not I'll look into providing a patch for one of them.

chipway’s picture

@Birk,

Yes in fact this site uses daterange_compact module.

I will test date_range_formatter and let you know.

Thanks for the tip.

chipway’s picture

@Birk,

I replaced daterange_compact module by date_range_formatter and found it more versatile.

But I still have the issue. I will wait for Core patch https://www.drupal.org/project/drupal/issues/2794481 when ready, and I am hearing for any other fix while waiting.

Big Thank for your help.

birk’s picture

Status: Active » Fixed
StatusFileSize
new899 bytes

--- This patch is NOT for optional_end_date ---

I've included a patch for the date_range_formatter module, so it renders dates without an end date as single day dates.

Note that I did not create a new issue in the date_range_formatter module, that would make it dependent on the current way of implementing optional end dates, which could (not very likely) change in the future.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

calinh’s picture

StatusFileSize
new206.56 KB

Hi, I have applied the patch and got this: Duminică 26 Iunie 10:00-{10}:{00} for this empty end date:
Empty end date

birk’s picture

I don't have time at the moment to look into this. And my knowledge of the Date range formatter is limited, since I've never used it my self.

Maybe open an issue for the date range formatter, asking if the maintainer could prepare the module for #2794481: Allow end date to be optional, that should fix the problem since this module still hits close enough to the current patch in the core issue.
Feel free to add this issue as a related issue, and maybe my previous patch is easily adapted to the newer date range foramtter versions.