I created a content type named Event and, obviously, with the event date field. After some nodes were created, the standard SmartDate format displays a different time within the parentheses, where I didn't find out where to change or delete this. I created a new date format using d M, however, after the date and month been displayed, there came again the parentheses, but this time with no content inside. Actually, I don't need any parentheses. I also noticed that the content within the parentheses changes according to some browsers, but the node(id) is the same. I attached some images. What am I doing wrong?

Comments

pharamis created an issue. See original summary.

mandclu’s picture

StatusFileSize
new103.8 KB

The parentheses are meant to show the time for an event in the site's timezone, if the event's timezone is different. I believe this isn't enabled by default in the provided Smart Date formats:

That said, it probably shouldn't display them at all if there's no output, and it should only show if the event timezone is different from the user or site timezone. Do you have timezone's explicitly set for the event, or perhaps the field? I would be interested to know what values you're using, especially for the example where it's showing but the same inside the parentheses.

As for showing different values per browser, is there a difference between browsers of whether or not you are logged in?

pharamis’s picture

Hi mandclu,
I am currently using the 8.x-2.9 version. After downloading the 3.0.0-rc1, 8.x-1.2 and 8.x-2.x-dev versions I noticed that the 3.0.0-rc1 is the only one which has the option shown at the attached image. I usually go for the version with the shield(Stable release covered by the Drupal Security Team). Are there any plans on releasing the option "Site Time" display for the Stable release?

As for showing different values per browser within the parentheses, I found out that only happens when the user is logged in. But according to the regional settings, the option "Users may set their own time zone" is unchecked. So, a peculiar behaviour.

Thank you for your fast response.

mandclu’s picture

Status: Active » Needs review
StatusFileSize
new983 bytes

The attached patch should help handle some of the oddities you ran into. Please test and let me know if this resolves them for you.

As for having the setting available in a stable release, at this point I'm probably more inclined to create a stable release of the 3.0.x branch, possibly as soon as we can get this issue resolved.

pharamis’s picture

I applied the patch, but ran into a failure message.

root#: patch -p1 < smart_date-site_timezone_display-3170559-4.patch
patching file src/SmartDateTrait.php
Hunk #1 FAILED at 82.
1 out of 1 hunk FAILED -- saving rejects to file src/SmartDateTrait.php.rej

mandclu’s picture

Version: 8.x-2.9 » 3.0.x-dev

Were you applying the patch against the 3.0.x-dev release (or possibly 3.0.0-rc1)?

pharamis’s picture

I am applying the patch against 8.x-2.9 version(stable release). That's the one I am currently using.

  • mandclu committed baf76f8 on 3.0.x
    Issue #3170559 by mandclu: Format Settings and display
    
mandclu’s picture

Status: Needs review » Fixed

Merged the changes into a new, stable 3.0.0 release. This should be resolved, but feel free to reopen if you continue to have issues.

pharamis’s picture

Thank you mandclu! It's fine now!

Status: Fixed » Closed (fixed)

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