datarange-filter-not-working-today-and-yesterday

Questionsdatarange-filter-not-working-today-and-yesterday
Vygandas Pigaga asked 5 years ago

If I choose today or yesterday – nothing.
If I choose last 7 days it includes 7 days, but not today.
If i choose month to date, it includes everything but not today.
https://imgur.com/a/QWtPV61

Mysql column type is datetime

phpgrid code for this column:

$col = array();
$col[“title”] = “Data”; // caption of column
$col[“name”] = “date”;
$col[“editable”] = true;
$col[“width”] = “60”;
$col[“formatter”] = “date”;
$col[“stype”] = “daterange”;
$col[“searchoptions”][“opts”] = array(“initialText”=>”Data Nuo-Iki”);
$col[“searchoptions”][“opts”][“datepickerOptions”] = array(“firstDay”=>”1”, “numberOfMonths”=>2);
$col[“editoptions”] = array(“size”=>20, “defaultValue” => date(“Y-m-d”));
$col[“formatoptions”] = array(“srcformat”=>’Y-m-d H:i:s’,”newformat”=>’Y-m-d H:i:s’);
$col[“editrules”] = array(“required”=>true); // and is required
$cols[] = $col;

Can You help ?

1 Answers
Abu Ghufran Staff answered 5 years ago

You can edit lib/inc/jqgrid_dist.php and search / replace following:

case ‘bt’ :
$qwery .= “($field >= ‘{$v[‘start’]}’ AND $field <= ‘{$v[‘end’]}’)”;
break;

WITH:

case ‘bt’ :
$qwery .= “($field >= ‘{$v[‘start’]} 00:00:00′ AND $field <= ‘{$v[‘end’]} 23:59:59′)”;
break;

It’s included in latest build as well.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

4 + 11 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?