This topic is locked
[SOLVED]

 PHPRUNNER 5.3 Using Both Date and Time Pickers on DATETIME field

9/18/2011 9:44:07 PM
PHPRunner General questions
M
MikeB941 author

PHPRUNNER 5.3 BUILD 7474
I have a DATETIME field and would like to be able to use the date picker and the time picker.
There doesn't appear to be any way to use both Date and Time Pickers as an EDIT AS option under the editor.
Is there a creative way - perhaps using alias/temporary fields to separate the date and time (using the picker on both) and then re-combining before the database update to accomplish this?

C
cgphp 9/19/2011

You can use an alias for the date field and set it as time and then combine the values before the db update.
In the Query section:

SELECT

field_1,

field_2,

date_field,

date_field as time_field

FROM table_name


Set date_field as date field and time_field as time field.
In the "Before record update":

$values["date_field"] = date("Y-m-d",strtotime($values["date_field"])) . " " . date("H:i:s",strtotime($values["time_field"]));

unset($values["time_field"]);

return true;