If I have a begin and end timestamp, and the date is the same on both time stamps, just display the difference in times.

For example, instead of displaying September 13, 2008 - 7:30pm - September 13, 2008 - 9:00pm, just display September 13, 2008, 7:30pm - 9:00pm.

CommentFileSizeAuthor
#3 date_ending_time.patch863 bytesthepanz

Comments

thepanz’s picture

Maybe you can display the first date complete, then only the HH:MM of the second in your theming functions..

aren cambre’s picture

I hear you, but the point of creating standardized modules with useful features is to allow users to avoid custom coding.

thepanz’s picture

Status: Active » Needs work
StatusFileSize
new863 bytes

Hi created that patch, it display only "hh:mm" of the date-to if the two dates are in the same day: if date_from->timestamp - date_to->timestamp is less than one day in seconds..

Let me know

patch is against DRUPAL-5 branch..

thepanz’s picture

I checked the HEAD version of Date module, this fix is already in!

karens’s picture

Hmm, no I didn't commit this change. It won't work quite right because you're using 24 hour time which may or may not be right, plus you haven't taken into account situations where the time wasn't supposed to show at all, you're code would display time no matter what. So this is not the right way to fix this.

This is actually harder than it sounds to do, which is why it isn't done.

thepanz’s picture

Hi KarenS, my patch was olny a really dirty edit of your module, I didn't except (neither want) that my patch could be committed in (I set Patch-need-work for that reason)!

oh, in HEAD version this feature isn't implemented yet, what I said in #4 isn't right!

karens’s picture

Status: Needs work » Fixed

This should be fixed in the 5.2 version, which is not quite ready for an official release. You can see that release if you look for 'other releases' on the project page. Try it in a test environment, or be prepared to update it as bugs are found and fixed.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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