Hello Alec:

On 2012-09-09 15:58, A.L.E.C wrote:
On 09/09/2012 02:30 PM, Achim wrote:

I have tried to update rcmail_format_date_col() from
program/steps/addressbook/func.inc (using date format string "s" for
timestamp), and format_date() from program/steps/addressbook/func.inc but RC still writes the date field as "Y-m-d", independent of what I use
in rcmail_format_date_col().

This function is used only to display the date. You need to convert the
field value in rcube_ldap::_map_data() method which is called before
inserting/updating LDAP entry.

That was the missing piece!

I added special cases (hardcoded) for the two fields birthday and anniversary (line 1567ff):

if ($fld && $val) {
   // The field does exist, add it to the entry.
   $ldap_data[$fld] = $val;
   // Special case: we should store the dates as Unix timestamp
   if (($col == "birthday") || ($col == "anniversary")) {
      $timestamp = strtotime($val);
      $ldap_data[$fld] = $timestamp;
   }
}

Perhaps this is not very elegant, but it works. Feel free to include/improve this.

On the same issue, does anybody know if only iPhone expects Unix timestamps, or if it is "The Right Thing To Do (TM)" for most clients?

Best regards, Achim
_______________________________________________
Roundcube Users mailing list
users@lists.roundcube.net
http://lists.roundcube.net/mailman/listinfo/users

Reply via email to