Date Format

Mark_Watson27 - June 16, 2009 - 22:17
Project:RSVP
Version:6.x-2.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:ulf1
Status:closed
Description

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

#1

ulf1 - June 16, 2009 - 22:56

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

#2

ulf1 - June 16, 2009 - 22:55
Category:support request» bug report
Assigned to:Anonymous» ulf1

#3

Mark_Watson27 - June 17, 2009 - 05:40

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

#4

Mark_Watson27 - June 17, 2009 - 08:07

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

#5

ulf1 - June 17, 2009 - 19:11
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

#6

System Message - July 1, 2009 - 19:20
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.