KoolReport's Forum

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

Issue with DateTimePicker #2013

Open Abhishek opened this topic on on Apr 5 - 4 comments

Abhishek commented on Apr 5

Dear Team, I am facing an issue with DateTimePicker that is I have implemented the DateTimePicker with some conditions in my report and now the issue is when I am selecting the date from 1th march to 31 march I am able to retrieve the data and then I am selecting from 1 feb 2021 to 31th feb 2021 then also I am able to retrieve the data but again if I am selecting the date 1th march to 31th march 2021 then the end date is not changing.

SELECT column names WHERE condition1 AND condition2 AND (DATE_FORMAT(column name, '%Y-%m-%d') >= STR_TO_DATE('01-03-2021', '%d-%m-%Y') AND DATE_FORMAT(column name, '%Y-%m-%d') <= STR_TO_DATE('28-02-2021', '%d-%m-%Y')) ORDER BY column name DESC
Abhishek commented on Apr 5

Dear Team, Please help me as soon as possible please.

Abhishek commented on Apr 5

Dear Team, In the below code I have used the conditions for the restriction of the selection of the date and now I am facing the above issue please help me out.

<?php 
				//$cdate = date('Y-m-d');
				//$strMinDate = date("01-m-Y", strtotime("-12 month"));
				//$strMaxDate = date('Y-m-t',strtotime($cdate));
				$strMinDate = date('Y-m-01',strtotime("-12 month"));
				$strMaxDate = date("Y-m-t", strtotime("last day of previous month"));
				$strMaxDate1 = date("Y-m-t", strtotime("last day of previous month"));

					DateTimePicker::create(array(
					"name"=>"startDatePicker",
					"minDate"=>$strMinDate,
					"maxDate"=>$strMaxDate1,
					"value"=>date("01-m-Y", strtotime("first day of previous month")),
					"format"=>"DD-MM-YYYY"
				));?>    
				 </div> 
					   

				<div class="row" style="text-align:center;">
				<div class="col-md-3 form-group" style="margin:auto 35%">
				<?php DateTimePicker::create(array(
					"name"=>"endDatePicker",
					"minDate"=>$strMinDate,
					"maxDate"=>$strMaxDate,
					"value"=>date("t-m-Y", strtotime("last day of previous month")),
					"format"=>"DD-MM-YYYY"
				));?> 
Abhishek commented on Apr 5

Dear Team, I am facing an issue with DateTimePicker that is I have implemented the DateTimePicker with some conditions in my report and now the issue is when I am selecting the date from 1th march to 31 march I am able to retrieve the data and then I am selecting from 1 feb 2021 to 31th feb 2021 then also I am able to retrieve the data but again if I am selecting the date 1th march to 31th march 2021 then the end date is not changing.

Dear Team, In the below code I have used the conditions for the restriction of the selection of the date and now I am facing the above issue please help me out.

Abhishek commented on Apr 6

Dear Team, In the below code I have used the conditions for the restriction of the selection of the date and now I am facing the above issue please help me out.

<?php 
				$cdate = date('Y-m-d');
				//$strMinDate = date("01-m-Y", strtotime("-12 month"));
				//$strMaxDate = date('Y-m-t',strtotime($cdate));
				$strMinDate = date('Y-m-01',strtotime("-12 month"));
				$strMaxDate = date("Y-m-t", strtotime("last day of previous month"));
				$strMaxDate1 = date("Y-m-t", strtotime("last day of previous month"));

					DateTimePicker::create(array(
					"name"=>"startDatePicker",
					"minDate"=>$strMinDate,
					"maxDate"=>$strMaxDate1,
					//"value"=>date("01-m-Y", strtotime("first day of previous month")),
					"format"=>"DD-MM-YYYY"
				));?>    
				 </div> 
					   

				<div class="row" style="text-align:center;">
				<div class="col-md-3 form-group" style="margin:auto 35%">
				<?php DateTimePicker::create(array(
					"name"=>"endDatePicker",
					"minDate"=>$strMinDate,
					"maxDate"=>$strMaxDate,
					//"value"=>date("t-m-Y", strtotime("last day of previous month")),
					"format"=>"DD-MM-YYYY"
				));?>            

Dear Team, I am facing an issue with DateTimePicker that is I have implemented the DateTimePicker with some conditions in my report and now the issue is when I am selecting the date from 1th march to 31 march I am able to retrieve the data and then I am selecting from 1 feb 2021 to 31th feb 2021 then also I am able to retrieve the data but again if I am selecting the date 1th march to 31th march 2021 then the end date is not changing.

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