I cant seem to get dateTimePicker to output with only date. No matter what I try it outputs with the time also
When I try and insert into mysql in setup function I can get dateRangePicker to only give me date but not dateTimePicker
mysql log no matter what I tried so far. I need to just remove the time from the datetimepicker. As I said I can get this to work fine with dateRangePicker but this report im doing here can only function with a single date.
the query in setup
$sql_activities = "
SELECT *,
date_format(activity_date, '%H%:%i') AS activity_time
FROM activities t1
RIGHT JOIN users t2 ON t2.user_id = t1.activity_user_id
WHERE t1.activity_date >= :start
AND t1.activity_date <= :end
AND t2.user_name = :emp
/*AND activity_date BETWEEN '2021-07-01 00:00:00' AND '2021-07-01 23:59:59'*/
";
the params in setup for the sql query
// pipe table data to activity report activities
$this->src('lp3')->query($sql_activities)
->params(array(
":start"=>$this->params["dateTime"],
":end"=>$this->params["dateTime"],
":emp"=>$this->params["user_name_activity"]
))
->pipe($this->dataStore("activities"));
my sqllog
RIGHT JOIN users t2 ON t2.user_id = t1.activity_user_id
WHERE t1.activity_date >= '2021-07-01 00:00:00'
AND t1.activity_date <= '2021-07-01 00:00:00'
AND t2.user_name = '31'
If i cant get it to format before the setup function, how would I format the date at the step to remove the time? could I use DateTimeFormatProcess and if so can you give me an example of that used
I have tried remove it before this step and no matter what I have tried I cant get the time to remove
If i dont give daterangePicker any paramValues it defaults to date only without time
Here is my defaultParamValues I have tried
return array(
"dateRange",
"user_name"=>"%",
//"dateTime",
//"dateTime"=>date("Y-m-d"),
"dateTime"=>array(date("Y-m-d")),
"user_name_activity"=>"%",
//"dateRange_activity"=>array(date("Y-m-d"),date("Y-m-d")),
"dateRange_activity"
);
When I try to format in the input it will only format the view of the input
DateTimePicker::create(array(
"name" => "dateTime",
"format"=>"YYYY-MM-DD",
// "options"=>array(
// ),
// "value"=>"Date"
));
I have tried to edit the DateTimePicker.php values also and commented them out and tried to change them to date only but it still outputs date and time
if($this->value===null)
{
$this->value=date('Y-m-d H:i:s');
//$this->value=date('Y-m-d');
}
else
{
$date = new \DateTime($this->value);
$this->value = $date->format("Y-m-d H:i:s");
//$this->value = $date->format("Y-m-d");
}
$this->locale = Utility::get($this->params,"locale");
$this->options = Utility::get($this->params,"options");
}