Hello,

Again, great module.

I'd sort of put up with the universal time display of start and end times, but unfortunately someone asked for it to be changed.
Basically all my date were coming through as YYYYMMDDTHHMMSSU so I changed the following line

rsvp_dateconnector.module - Line 142

    /* $date_out = date_format($date, date_type_format($field['type'])); */
    $date_out = date_format($date, 'd/m/Y - H:i');

And the same for the End Date.

Is this something I'm missing in an easy configuration somewhere?

Thanks
Mark

Comments

ulf1’s picture

Assigned: ulf1 » Unassigned
Category: bug » support

Thanks for reporting.

I have to admit, that I am not happy in how dates are being handled right now, but the Date module does not leave me any other option then to store strings which then in turn need to be transformed which does not work properly at the moment.
And I also did not pay a lot of attention to this detail.

Before I fix this, I assume the output that we wish to see would be the same that you select for the content type in the "display Field" settings of the content type which you can change through the following link http://YOURDOMAIN/admin/content/node-type/YOURCONTENTTYPE/display ?

Or is there any reason to use a different format, like the one selected under "Manage Fields" http://YOURDOMAIN/admin/content/node-type/YOURCONTENTTYPE/fields/YOURFIELD ? I do not think so.

Please let me know and I can make the changes.

Thanks,
Ulf

ulf1’s picture

Assigned: Unassigned » ulf1
Category: support » bug
Mark_Watson27’s picture

Assigned: Unassigned » ulf1
Category: support » bug

Hello Ulf,

Thanks for the swift reply.

I'd like it to return the same format as http://YOURDOMAIN/admin/content/node-type/YOURCONTENTTYPE/fields/YOURFIELD which is d/m/Y - H:i:s the options under display do not give me any date formatting options other than

  • Display From and To dates
  • Display From date only
  • Display To date only

Thanks
Mark

Mark_Watson27’s picture

Incidently changing it to the following makes it more readable as well, but still not the fields actual display type.

$date_out = date_format_date($date, date_type_format($field['type']));

I think this passes it to the date module to format it, but I'm still getting used to Drupal.

Thanks
Mark

ulf1’s picture

Status: Active » Fixed

Hi Mark,

after looking into this more closely, I recognize that there is no golden rule which format to choose.

- The format options under 'Manage fields" are suppose to be used only when entering a date.
- The format options under 'Display fields" are suppose to be used when displaying a date field inside a node, but all the code to get and format the date is not well suited for what I do right now.

To make this right, the best way would be to have a separate setting in RSVP, but that makes it more complicated and I would say it is a feature for a future release.

What do you think about using the "Default Display" setting from the global section of the "Managing Field" tab? There should be a format that satisfies your requirement, and if not you might consider changing your sites global defaults.

I made the changes. Try the latest dev version and let me know if it works for you.

~
Ulf

Status: Fixed » Closed (fixed)

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

sdsheridan’s picture

I think it would be helpful for the start and end dates to be available to the rsvp_preprocess theming function, so that if an alternate date format is desired on the site-displayed invitation, then that can be achieved through theme overrides. The format_date function in the connector does a lot of the necessary heavy lifting in determining the from and to dates, so perhaps this is a good place to achieve that, so all that code runs just once. I hacked the date connector (and all the other necessary places) to add a $from_to array passed by reference as a last parameter to the function, and then in function template_preprocess_rsvp_invitation, I passed the bits of that array (two date objects) on in the $variables array so that my theme could re-theme the date.

The reason I did this is that I was getting dates like Thu, Apr 7, 2011 - 6:00pm - Thu, Apr7, 2011 - 8:00pm, which looks a bit ugly... my client wanted them to just be Thu, Apr 7, 2011 - 6:00-8:00pm. By passing the from- and to-date objects, I was able to use a bit of logic in my theme to produce that format, and then simply replace the 'startdate' element with my newly formatted date.