How to customize the date format in a delegate class

This how-to is aimed at changing the date format inside the date fields when creating or modifying a record.

This customization is done in a delegate class.
For example, The delegate class is in a file which is named like the table name it is related with.
To act upon the date format, we use methods inside the class. Their name is made of the field name followed by a double underscore and a key word.
For example here
function current_date__default() {
return date('d/m/Y');
}
This method add the current date in an empty field

Powered by Dataface
(c) 2005-2007 All rights reserved