KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

DateTimePicker issue #2003

Closed Abhishek opened this topic on on Mar 31, 2021 - 14 comments

Abhishek commented on Mar 31, 2021

Respected Team, I am trying to implement the DateTimePicker functionality in my report but when i have implemented it is throwing the following error so please could you help me.

Fatal error: Uncaught TypeError: DateTime::construct() expects parameter 1 to be string, array given in C:\xampp\htdocs\test\vendor\koolreport_pro-5.0.4\koolreport\inputs\DateTimePicker.php:78 Stack trace: #0 C:\xampp\htdocs\test\vendor\koolreport_pro-5.0.4\koolreport\inputs\DateTimePicker.php(78): DateTime->construct(Array) #1 C:\xampp\htdocs\test\vendor\koolreport_pro-5.0.4\koolreport\core\src\core\Widget.php(157): koolreport\inputs\DateTimePicker->onInit() #2 C:\xampp\htdocs\test\vendor\koolreport_pro-5.0.4\koolreport\core\src\core\Widget.php(758): koolreport\core\Widget->__construct(Array) #3 C:\xampp\htdocs\test\potcalling\potreport.view.php(27): koolreport\core\Widget::create(Array) #4 C:\xampp\htdocs\test\vendor\koolreport_pro-5.0.4\koolreport\core\src\KoolReport.php(502): include('C:\xampp\htdocs...') #5 C:\xampp\htdocs\test\potcalling\index.php(4): koolreport\KoolReport->render() #6 {main} thrown in C:\xampp\htdocs\test\vendor\koolreport_pro-5.0.4\koolreport\inputs\DateTimePicker.php on line 78

Abhishek commented on Mar 31, 2021

And Unable to retrieve the data when submit button is clicked.

Abhishek commented on Mar 31, 2021

Respected Team, Please could anyone can help me please

KoolReport commented on Mar 31, 2021

The error means that you have input into DateTimePicker an array value, it should be string. Please check the value property of DateTimePicker, make sure that it is string in form of date time like "2010-12-10 00:00:00"

Abhishek commented on Mar 31, 2021

Dear Team, This is my view code of the DateTimePicker. could you please help me out because I have not used any property named value for DateTimePicker. And unable to display the data also

<?php 
DateTimePicker::create(array(
    "name"=>"startDatePicker",
    //"maxDate"=>"@endDatePicker",
    "format"=>"YYYY/MM/DD"
));
?> 
<?php 
DateTimePicker::create(array(
    "name"=>"endDatePicker",
    //"minDate"=>"@startDatePicker",
    "format"=>"YYYY/MM/DD"
));
?>

and This is my business logic code

WHERE
		Columnname = :startDatePicker
                AND
                Columnname= :endDatePicker
		->params(array(
            ":startDatePicker"=>$this->params["startDatePicker"],
            ":endDatePicker"=>$this->params["endDatePicker"],
return array(
            "startDatePicker"=>array(
			date("Y-m-d")
			),
			"endDatePicker"=>array(
			date("Y-m-d")
			),
return array(
            //"dateRange"=>"dateRange",
			"startDatePicker"=>"startDatePicker",
            "endDatePicker"=>"endDatePicker",
KoolReport commented on Mar 31, 2021

try:

"startDatePicker"=>date("Y-m-d"),
"endDatePicker"=>date("Y-m-d"),
Abhishek commented on Mar 31, 2021

Dear Team, please help me to display data only for current month else current month between dates. I mean how to disable the next month and last month in date selection.

Abhishek commented on Mar 31, 2021

Dear Team, please help me to display data only for current month else current month between dates. I mean how to disable the next month and last month in date selection.

Abhishek commented on Mar 31, 2021

Dear Team, please help me to display data only for current month else current month between dates. I mean how to disable the next month and last month in date selection.

Abhishek commented on Mar 31, 2021

Dear Team, Could you please help me on how to disable the selection of the previous month in the DateTimePicker please help me.

Abhishek commented on Mar 31, 2021

Dear Team, Could you please help me on how to disable the selection of the previous month in the DateTimePicker please help me.

Abhishek commented on Mar 31, 2021

Dear Team, Can I get solution for my issue here.

Abhishek commented on Mar 31, 2021

Dear Team, Could you please help me on how to disable the selection of the previous month in the DateTimePicker please help me.

Can I except the solution from your supporting please.

Abhishek commented on Mar 31, 2021

Dear Team, Please help me on how to code for disable of selecting the previous and next month/date in DateTimePicker. Please help me.

KoolReport commented on Mar 31, 2021

You set the min date to 1st day of current month and max date is the last day of the current month.

Here is the documentation of minDate and maxDate.

P.S: You do not need to post continuously to get answer.

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed

Inputs