[development] new form api: dates works?

Fabio Varesano fabio.varesano at gmail.com
Mon Dec 12 21:26:12 UTC 2005


Thank you...

but I'm doing a print_r($node) before inserting
to the database.. so getting [closing_date] => 1
printed should mean that there are some problems
in getting the date values from the apis...

I made some investigations on other modules wich
uses calls to form api for dates...
found profile.module (in core).

I created a new profile field as date (birthdate)
and tryed to assign it a value on my profile page..
but also this seems not to work...

Alwais getting 01/01/1 as birthdate....

Fabio


p.s.: I didn't find where you used date form api
on your sandbox



Simon Lindsay wrote:
> Fabio Varesano wrote:
> 
>> function goods_request_insert($node) {
>>   print_r($node); die();
>>   db_query('INSERT INTO {goods_request} (nid, vid, tid, closing_date,
>> shipping_address) VALUES (%d, %d, %d, %d, %s)', $node->nid, $node->vid,
>> $node->tid, $node->closing_date, $node->shipping_address);
>> }
> 
> 
> I think you need to have
> 
> VALUES (%d, %d, %d, %s, %s)
> 
> as using %d will convert it to a number, and 2005-12-12 15:41:09 +0000
> wont convert well ;-)
> 
> It looks like you might be making a purchase order type of module?
> 
> I'm working on an estimate/invoice/purchase order system for my small pc
> shop, my code is in contribs/sandbox/simon/pcshop.
> 
> Take a look if you like, comments/assistance/code reuse appreciated ;-)
> 
> TIA
> 
> Simon
> 



More information about the development mailing list