Hi, When I use your module to show a date field, when seeing the list, the date show in this way:

a:3:{s:4:"year";s:4:"1965";s:5:"month";s:2:"10";s:3:"day";s:1:"8";}

Comments

pukku’s picture

Title: Display a Dete Profile » Display a Date Field
Assigned: Unassigned » pukku
Status: Active » Closed (duplicate)

Hi! This is really the same problem as http://drupal.org/node/138113. The code there won't help you, because the 5.x codebase has completely changed. I do have plans to solve this problem in a better way, but it may take some time, because I have a number of other things than need to happen first.

In the short term, you could make it display properly with an eval template, but I don't have the code for that one off the top of my head. Also, that wouldn't be searchable or sortable.

Ricky

tanjerine’s picture

Hi! I have been wrestling with this same problem the past 2 hours. I came up with a kludge* for this, in case anyone has the same problem. here's how i did it for my setup (drupal 4.7 using postgres):

under the site_user_list.module file look for function _site_user_list_regen (around line 393 or so). i edited the while loop (~line 411) to look like this

while($field = db_fetch_array($fields_query)) {
    if ($allowed[$field['name']]) {

      $fid = $field['fid'];
      $tbl = 't_' . $fid;
      $col = $field['name'];

           // added kludge for date fields
           // profile_bday can be changed to any field name the uses the date field in the profile module.
           if ($field['name'] == 'profile_bday' ) {
	$cols[] = "( (split_part(split_part($tbl.value,';',4),'\"',2)) || '-' || split_part(split_part($tbl.value,';',6),'\"',2) || '-' || split_part(split_part($tbl.value,';',2),'\"',2) ) as $col ";		
           } else {
                // everything else
     	$cols[] = "$tbl.value as $col";
           }
      $joins[] = "LEFT OUTER JOIN {profile_values} as $tbl on (u.uid = $tbl.uid and $tbl.fid = $fid)";
    }

this works for my site and it's sortable & searchable too.
* there probably is a better way, but im a relatively new drupal user....

tanjerine’s picture

my bad... i forgot the last " } " in my submitted code. and i couldn't edit my previous post. oh, and yes, i know the issue is for 5.x but i experienced the same thing with 4.7 so i thought to submit my kludge here. :)

mdekkers’s picture

I am seeing the same issue - do you have an idea when this would be looked at?

mrottke’s picture

Version: 5.x-1.x-dev » 6.x-1.1-beta1

Seems the issue still persists with 6.x-1.1-beta1
Any chance you'll find the time to fix that?