My thinking is if there's already a function there, maybe there's someway I
can use it without doing my own. I'm tried concatinating the fields, but
that didn't work so well (stuff like 1:02 am, for some reason becomes 1:2 am
and then strtotime doesn't work).
--
Baz L
Web Development 2.0: Web Design, CakePHP, Javascript
http://www.WebDevelopment2.com/

On Dec 5, 2007 4:29 AM, Adam Royle <[EMAIL PROTECTED]> wrote:

>
> Is it a big deal to not have them in the database? Maybe if I
> understood the context a bit better then I might be able to suggest
> something more appropriate.
>
> In my forms when I have datetime fields, I separate them off into two
> fields - date as d/m/y and time as any string strtotime() handles.
>
> Then in my AppController I have overrided the cleanUpFields() and put
> my own date logic in there, which converts my custom form elements to
> a date string cakephp can handle. It is however tied in automatically
> with the model definition like cakephp core is. It also sets the date
> value to null if the field is blank.
>
> If you're not saving the data into a model, then maybe you can just
> write a function that takes in the field name and returns the combined
> date value, and put that in your appcontroller or something like that.
>
> Cheers,
> Adam
>
> On Dec 5, 5:57 pm, Baz <[EMAIL PROTECTED]> wrote:
> > OK,
> >
> > I've banged my head against the wall a million times. This is my
> problem:
> >
> > I got date and time fields which I need. They are not associated with
> the
> > model or database.
> >
> > I call them like so:
> >
> >         echo $form->input('from', array('label' => 'From', 'type' =>
> 'date',
> > 'div' => 'date'));
> >         echo $form->input('to', array('label' => 'To', 'type' => 'date',
> > 'div' => 'date'));
> >         echo $form->input('time', array('label' => 'Time', 'type' =>
> 'time',
> > 'div' => 'date'));
> >
> > However, cleanUpFields doesn't work it's magic like if those fields were
> in
> > the database.
> >
> > Any ideas?
> > Is there a way to force the model to consider those fields as its own?
> >
> > Ideas would be greatly appreciated.
> > --
> > Baz L
> > Web Development 2.0: Web Design, CakePHP,
> Javascripthttp://www.WebDevelopment2.com/
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to