Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Re: [olivers] How to transform date input?

Quote Reply
Re: [olivers] How to transform date input? In reply to
The code of Jean's subroutine for "add_record hook" also works for "modify_record hook":

Code:

sub modify_record {
my ($home) = @_;
my $cfg = Dbsql::Plugins->get_plugin_user_cfg ('PluginName');
$home->{cgi}->{$cfg->{date_col_name}} = GT::Date::date_transform($home->{cgi}->{$cfg->{date_col_name}},$cfg->{orig_format},$cfg->{new_format});
return @_;
}


I've tested it: first, I had a problem because I've installed several plugins that haven't been
loaded in the right order. After some research in the forum, I found a solution about how to
load the plugins in a specific order. Everything was fine after that Smile

Does anyone have a solution for the modify_form hook? And another thing: sometimes, you
might have several date fields in a database - what's the best way to "enrich" Jean's plugin
with this functionality?

Thanks for your help and have a good time
Oliver
Subject Author Views Date
Thread How to transform date input? Armin 5151 Dec 5, 2002, 5:18 AM
Thread Re: [Armin] How to transform date input?
Inertia 5070 Dec 5, 2002, 12:18 PM
Thread Re: [Inertia] How to transform date input?
Armin 5047 Dec 5, 2002, 1:58 PM
Thread Re: [Armin] How to transform date input?
jean 5045 Dec 5, 2002, 3:28 PM
Post Re: [jean] How to transform date input?
Armin 5031 Dec 6, 2002, 12:16 AM
Thread Re: [jean] How to transform date input?
olivers 4711 Jun 1, 2004, 2:16 AM
Thread Re: [olivers] How to transform date input?
olivers 4702 Jun 1, 2004, 2:59 AM
Thread Re: [olivers] How to transform date input?
olivers 4646 Jun 20, 2004, 12:10 PM
Post Re: [olivers] How to transform date input?
olivers 4641 Jun 21, 2004, 8:39 AM