Monday, March 30, 2009

Re: Save null or empty datetime fields

Edwin,

I have a similar interest. I have started a new application with 40+
tables and I am trying to get as much mileage as possible from "baked"
models, views and controllers.

In several tables I have DATE fields that allow NULL dates. For
example, in the equipment_items table, the disposal_date field should
be empty/NULL until the equipment is disposed of.

In the default baked views, though, those dates appear in the form as
January 1 2029 and if I save a new record or edit an existing, it will
save date as 2029-01-01 in place of the desired 0000-00-00. The DATE
fields in question are set to accept NULL.

So, I am also interested in the easiest way to modify bake-generated
MVC to permit this.

Jim


On Mar 18, 2:00 pm, edwingt <edwin.al...@gmail.com> wrote:
> Hello,
> I want to save an emptydatefield, but I cant.
> There are some options to tell thedatefield that can benull?
> I already check that no rule is defined in the model, for thedate
> field and the databasedatefield accepts nulls.
>
> Any advice?

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

No comments: