Hi there!
I have many date fields that doesn´t have "to" date. They have just one date, the initial one. Those fields work and should be shown, the same way as the "posted" date.
But in those cases, they are shown twice.
In example: Field "Last day you´ve aten tomatoes", on 10/01/2009
And instead of be shown like 10/01/2009, it shows like 10/01/2009 - 10/01/2009.
I´ve marked this as a bug, because those fields were shown and existed long before I´ve updated to the latest release, and now, they are not shown as they should anymore.
Thanks for your help!
Rosamunda

Comments

choster’s picture

mattez’s picture

Same issue. *** partially fixed ***

In date field setup:
To Date > "Never"

Output on page (from Devel Themer):
function used: theme_date_display_range();
Variables:

 ...  (Array, 3 elements)
    * date1 (String, 64 characters ) <span id="thmr_10" class="thmr_call"> 4. October 2009</span>
    * date2 (String, 64 characters ) <span id="thmr_11" class="thmr_call"> 4. October 2009</span>
    * timezone (String, 0 characters )

Problem:
IMHO combination od BUG & USING DEVEL THEMER!! Disable it and works fine.
Why?
in date.theme:

			...
131		// From and To dates match or there is no To date, display a complete single date.
132		elseif ($date1 == $date2 || empty($date2)) {
133		$output .= theme('date_display_single', $date1, $timezone);
			...

empty($date2) = is not empty!! - should be!!

$date1 == $date2 is not equal, thanks to DEVEL THEMER which is adding s with unique ID

I'm not programmer, but there is probably problem with saving data to DB - $date2 should be empty. Some more advanced homeboy should try check it,... Thanx ;)

ekes’s picture

Well switching devel themer off does solve it.

And it's not in the DB. So it's an assumption made at one point (date) or other (devel themer) on display. Does the theme function get the original date as well as the date strings to be displayed? ie could they be compared?

gianni.s’s picture

Hi guys,
same issue using a Datetime field and I found a relationship with the "time" part of the same "from" field.
I have no "to date" field and I use the initial date only, and:

- when I leave the time part blank (or set it to 00:00), I see: 10 Feb 2010 (Tutto il giorno)

- when I set the time part (by any value except 00:00), I see: 10 Feb 2010 - 12:00

If the italian "Tutto il giorno" means 10 Feb 2010 - 10 Feb 2010, it seems that time part in the initial date is related to the "to date" information storing or displaying function.

Gianni

bluestarstudios’s picture

I've found a similar problem. using the "c" handler to display the ISO format displays it twice. (#736828: ISO 8601 "c" displays duplicate)
2010-03-17T04:58:58-04:00 2010-03-17T04:58:58-04:00
However when I changed the format handler to "Y-m-d\TH:i:sP" it displays the following thing:
2010-03-17T04:58:58-04:00 -04:00
So it seems like the timezone element is trying to add itself to a "to date" item whether it exists or not?

Please lets get this fixed...

robbertnl’s picture

Same issue, but disabling devel themer works here as well. So it's an issue only when using devel themer i think

arlinsandbulte’s picture

Title: Date fields with no "to" date, show twice the "initial date" » Date fields with no "to" date, show the "From date" twice when devel theme module is enabled

The problem is that the date theme layer checks to see if the From and To date is equal. If they are equal, the date theme layer only outputs the From date.

#2 is exactly correct. Devel theme module adds some stuff to the From date and To date, which makes these values not equal when they should be.

coleman.sean.c’s picture

@bluestar: For what it's worth, that behavior is set by theme_date_display_single(), which is a themeable function. You can copy it from date.theme, remove the references to $timezone, and save the modified version in your template.php file as mythemename_date_display_single().

martin.l’s picture

subscribing.

bjmiller121’s picture

Issue summary: View changes
Related issues: +#736828: ISO 8601 "c" displays duplicate

I came up with a similar solution to #9, but using template_preprocess_date_display_single() instead.

See: https://www.drupal.org/node/736828#comment-8992119

damienmckenna’s picture

Status: Active » Closed (won't fix)

Unfortunately the Drupal 6 version of the Date module is no longer supported. That said, we appreciate that you took time to work on this issue. Should this request still be relevant for Drupal 7 please feel free to reopen it. Thank you.