Hi Stu,
I tried it out with "datetime" column but that doesn't work, either.
Result is "null" in the column.
Here's part of my code:
add.cpt:
...
<tr>
<td style="text-align:right;">Opening time</td>
<td style="text-align:left;">from <?php echo $form->hour
('OpeningStartHours',1,6);?> : <?php echo $form->minute
('OpeningStartMinutes',0,null,"00");?>
to <?php echo
$form->hour('OpeningEndHours',
1,18);?> : <?php echo $form->minute('OpeningEndMinutes',0,null,"00");?
> o'clock
</td>
</tr>
...
mycontroller:
....
function add() {
....
$startMinutes = $data['myobject']['OpeningStartMinutes'];
$startHours = $data['myobject']['OpeningStartHours'];
$endMinutes = $data['myobject']['OpeningEndMinutes'];
$endHours = $data['myobject']['OpeningEndHours'];
$data['myobject']['OpeningStartMinutes'] = $startMinutes['min'];
$data['myobject']['OpeningStartHours'] = $startHours['hour'];
$data['myobject']['OpeningEndMinutes'] = $endMinutes['min'];
$data['myobject']['OpeningEndHours'] = $endHours['hour'];
....
That way it works, but of course it's quite complicated always
converting those values and storing them in 4 different fields.
After your hint I tried it with a datetime "OpeningStart" and
"OpeningEnd" field like this
...
<tr>
<td style="text-align:right;">Opening time</td>
<td style="text-align:left;">from <?php echo $form->hour
('OpeningStart',1,6);?> : <?php echo $form->minute('OpeningStart',
0,null,"00");?>
to <?php echo
$form->hour('OpeningEnd',1,18);?> :
<?php echo $form->minute('OpeningEnd',0,null,"00");?> o'clock
</td>
</tr>
...
and commented out the conversion code in my controller, but that
resulted in "null" values for "OpeningStart" and "OpeningEnd" in the
database.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---