Re: Re: Formbuilder: Date

From: Date: Thu, 26 Aug 2004 20:36:24 +0000
Subject: Re: Re: Formbuilder: Date
References: 1 2 3  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-14314@lists.php.net to get a copy of this message
Is there a way to use the dateToDatabaseCallback function in individual forms (overriding the global setting)? ie, $fg->dateToDatabaseCallback = 'dateToDB'; where a specific page needs one display format different from the global setting for the site? If so how would you set the syntax? Thanks, s. Markus Wolff wrote: > Tobias Nix wrote: > > >> Do i have to set a specific format in the db for > >> the date field? > > > > has to be date or datetime. > > If the dateFields property is used (as described), other field types can > be used as well. You'll just have to define the proper callback > functions for date format conversion in your .ini file: > > [DB_DataObject_FormBuilder] > dateToDatabaseCallback = dateToDB > dateFromDatabaseCallback = dateFromDB > > The above setting will call the (global) function dateToDB() whenever a > date is to be converted from the user input format to the storage format > in the database. dateFromDB() will be called for the opposite task. > > CU > Markus > > -- > PEAR General Mailing List (http://pear.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.pear.general (#14314) next »