Date Range filter not working in custom Grid Magento 2How to Add filter index with alias name in ui component of grid magento2Custom renderered column sorting not working magento2how to join fields like product skus in sales order grid collection in magento2?Magento 2 grid uiComponent: include a table alias in a column filterfilter_condition_callback using Ui Component - Magento 2Customer export not working after creating custom attributes in magento 2.2.5Custom column in Product Grid not being filtered?How to Filter a Custom Column in Product Listing?Magento 2.3 Ui grid not working when store column is presentMagento 2 How to add SKU in Order Grid with filter

If Dutch railways suggests a 5-min connection, is it definitely doable?

Would letting a multiclass character rebuild their character to be single-classed be game-breaking?

Are randomly-generated passwords starting with "a" less secure?

Was the Ford Model T black because of the speed black paint dries?

Assign media item to sitecore item using powershell script

Keep milk (or milk alternative) for a day without a fridge

Machine learning and operations research projects

Bishop game - python

Is it possible for thermophilic viruses to infect humans?

Professor falsely accusing me of cheating in a class he does not teach, two months after end of the class. What precautions should I take?

Extract an attribute value from XML

Why can't supermassive black holes merge? (or can they?)

Did any of the founding fathers anticipate Lysander Spooner's criticism of the constitution?

What does the standard say about char arrays as template arguments?

Redirect https to fqdn

The monorail explodes before I can get on it

Is purchasing foreign currency before going abroad a losing proposition?

Who Can Help Retag This?

I quit, and boss offered me 3 month "grace period" where I could still come back

Correct use of ergeben?

Is a Lisp program in both prog-mode and lisp-mode?

Where is the USB2 OTG port on the RPi 4 Model B located?

As the Dungeon Master, how do I handle a player that insists on a specific class when I already know that choice will cause issues?

Were there any new Pokémon introduced in the movie Pokémon: Detective Pikachu?



Date Range filter not working in custom Grid Magento 2


How to Add filter index with alias name in ui component of grid magento2Custom renderered column sorting not working magento2how to join fields like product skus in sales order grid collection in magento2?Magento 2 grid uiComponent: include a table alias in a column filterfilter_condition_callback using Ui Component - Magento 2Customer export not working after creating custom attributes in magento 2.2.5Custom column in Product Grid not being filtered?How to Filter a Custom Column in Product Listing?Magento 2.3 Ui grid not working when store column is presentMagento 2 How to add SKU in Order Grid with filter






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








2















I have created the custom sales report using ui component.



Grid is loading correctly. I have added the date range filter as like below.



<column name="created_at" class="MagentoUiComponentListingColumnsDate">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">dateRange</item>
<item name="component" xsi:type="string">Magento_Ui/js/grid/columns/date</item>
<item name="dataType" xsi:type="string">date</item>
<item name="label" xsi:type="string" translate="true">Created At</item>
<item name="dateFormat" xsi:type="string">Y-MM-dd HH:mm:ss</item>
</item>
</argument>
</column>


Here is the screenshot of error.



enter image description here



In the filter section when the from and To date selected and applied,
I am getting Bad request error.



This is the error in Request



 error: "UI component could not be rendered because of system exception", errorcode: "23000" 


error: "UI component could not be rendered because of system exception"
errorcode: "23000"



Can anyone check where i am wrong and help me to resolve this error. The answers provided below all i tried but no solution for it.



Thanks in Advance










share|improve this question

















This question has an open bounty worth +50
reputation from jafar pinjar ending ending at 2019-07-15 12:56:05Z">in 3 days.


Looking for an answer drawing from credible and/or official sources.


Please update me your thoughts on this.
















  • can you share the screenshot of error?

    – Mohit Rane
    Jul 4 at 13:35











  • @MohitRane, added the error screenshot, pls have a look

    – jafar pinjar
    Jul 4 at 13:37











  • check removing <item name="dateFormat" xsi:type="string">Y-MM-dd HH:mm:ss</item> this code and check if everything is working

    – Mohit Rane
    Jul 4 at 13:42











  • @MohitRane, No same error after that also, cleared cache and checked it

    – jafar pinjar
    Jul 4 at 13:45






  • 1





    @MohitRane, I am not using custom table, using sales_order_item table for loading collection

    – jafar pinjar
    Jul 4 at 13:58


















2















I have created the custom sales report using ui component.



Grid is loading correctly. I have added the date range filter as like below.



<column name="created_at" class="MagentoUiComponentListingColumnsDate">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">dateRange</item>
<item name="component" xsi:type="string">Magento_Ui/js/grid/columns/date</item>
<item name="dataType" xsi:type="string">date</item>
<item name="label" xsi:type="string" translate="true">Created At</item>
<item name="dateFormat" xsi:type="string">Y-MM-dd HH:mm:ss</item>
</item>
</argument>
</column>


Here is the screenshot of error.



enter image description here



In the filter section when the from and To date selected and applied,
I am getting Bad request error.



This is the error in Request



 error: "UI component could not be rendered because of system exception", errorcode: "23000" 


error: "UI component could not be rendered because of system exception"
errorcode: "23000"



Can anyone check where i am wrong and help me to resolve this error. The answers provided below all i tried but no solution for it.



Thanks in Advance










share|improve this question

















This question has an open bounty worth +50
reputation from jafar pinjar ending ending at 2019-07-15 12:56:05Z">in 3 days.


Looking for an answer drawing from credible and/or official sources.


Please update me your thoughts on this.
















  • can you share the screenshot of error?

    – Mohit Rane
    Jul 4 at 13:35











  • @MohitRane, added the error screenshot, pls have a look

    – jafar pinjar
    Jul 4 at 13:37











  • check removing <item name="dateFormat" xsi:type="string">Y-MM-dd HH:mm:ss</item> this code and check if everything is working

    – Mohit Rane
    Jul 4 at 13:42











  • @MohitRane, No same error after that also, cleared cache and checked it

    – jafar pinjar
    Jul 4 at 13:45






  • 1





    @MohitRane, I am not using custom table, using sales_order_item table for loading collection

    – jafar pinjar
    Jul 4 at 13:58














2












2








2








I have created the custom sales report using ui component.



Grid is loading correctly. I have added the date range filter as like below.



<column name="created_at" class="MagentoUiComponentListingColumnsDate">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">dateRange</item>
<item name="component" xsi:type="string">Magento_Ui/js/grid/columns/date</item>
<item name="dataType" xsi:type="string">date</item>
<item name="label" xsi:type="string" translate="true">Created At</item>
<item name="dateFormat" xsi:type="string">Y-MM-dd HH:mm:ss</item>
</item>
</argument>
</column>


Here is the screenshot of error.



enter image description here



In the filter section when the from and To date selected and applied,
I am getting Bad request error.



This is the error in Request



 error: "UI component could not be rendered because of system exception", errorcode: "23000" 


error: "UI component could not be rendered because of system exception"
errorcode: "23000"



Can anyone check where i am wrong and help me to resolve this error. The answers provided below all i tried but no solution for it.



Thanks in Advance










share|improve this question
















I have created the custom sales report using ui component.



Grid is loading correctly. I have added the date range filter as like below.



<column name="created_at" class="MagentoUiComponentListingColumnsDate">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">dateRange</item>
<item name="component" xsi:type="string">Magento_Ui/js/grid/columns/date</item>
<item name="dataType" xsi:type="string">date</item>
<item name="label" xsi:type="string" translate="true">Created At</item>
<item name="dateFormat" xsi:type="string">Y-MM-dd HH:mm:ss</item>
</item>
</argument>
</column>


Here is the screenshot of error.



enter image description here



In the filter section when the from and To date selected and applied,
I am getting Bad request error.



This is the error in Request



 error: "UI component could not be rendered because of system exception", errorcode: "23000" 


error: "UI component could not be rendered because of system exception"
errorcode: "23000"



Can anyone check where i am wrong and help me to resolve this error. The answers provided below all i tried but no solution for it.



Thanks in Advance







magento2 collection uicomponent






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jul 9 at 10:35







jafar pinjar

















asked Jul 4 at 13:30









jafar pinjarjafar pinjar

1,0914 silver badges23 bronze badges




1,0914 silver badges23 bronze badges






This question has an open bounty worth +50
reputation from jafar pinjar ending ending at 2019-07-15 12:56:05Z">in 3 days.


Looking for an answer drawing from credible and/or official sources.


Please update me your thoughts on this.








This question has an open bounty worth +50
reputation from jafar pinjar ending ending at 2019-07-15 12:56:05Z">in 3 days.


Looking for an answer drawing from credible and/or official sources.


Please update me your thoughts on this.














  • can you share the screenshot of error?

    – Mohit Rane
    Jul 4 at 13:35











  • @MohitRane, added the error screenshot, pls have a look

    – jafar pinjar
    Jul 4 at 13:37











  • check removing <item name="dateFormat" xsi:type="string">Y-MM-dd HH:mm:ss</item> this code and check if everything is working

    – Mohit Rane
    Jul 4 at 13:42











  • @MohitRane, No same error after that also, cleared cache and checked it

    – jafar pinjar
    Jul 4 at 13:45






  • 1





    @MohitRane, I am not using custom table, using sales_order_item table for loading collection

    – jafar pinjar
    Jul 4 at 13:58


















  • can you share the screenshot of error?

    – Mohit Rane
    Jul 4 at 13:35











  • @MohitRane, added the error screenshot, pls have a look

    – jafar pinjar
    Jul 4 at 13:37











  • check removing <item name="dateFormat" xsi:type="string">Y-MM-dd HH:mm:ss</item> this code and check if everything is working

    – Mohit Rane
    Jul 4 at 13:42











  • @MohitRane, No same error after that also, cleared cache and checked it

    – jafar pinjar
    Jul 4 at 13:45






  • 1





    @MohitRane, I am not using custom table, using sales_order_item table for loading collection

    – jafar pinjar
    Jul 4 at 13:58

















can you share the screenshot of error?

– Mohit Rane
Jul 4 at 13:35





can you share the screenshot of error?

– Mohit Rane
Jul 4 at 13:35













@MohitRane, added the error screenshot, pls have a look

– jafar pinjar
Jul 4 at 13:37





@MohitRane, added the error screenshot, pls have a look

– jafar pinjar
Jul 4 at 13:37













check removing <item name="dateFormat" xsi:type="string">Y-MM-dd HH:mm:ss</item> this code and check if everything is working

– Mohit Rane
Jul 4 at 13:42





check removing <item name="dateFormat" xsi:type="string">Y-MM-dd HH:mm:ss</item> this code and check if everything is working

– Mohit Rane
Jul 4 at 13:42













@MohitRane, No same error after that also, cleared cache and checked it

– jafar pinjar
Jul 4 at 13:45





@MohitRane, No same error after that also, cleared cache and checked it

– jafar pinjar
Jul 4 at 13:45




1




1





@MohitRane, I am not using custom table, using sales_order_item table for loading collection

– jafar pinjar
Jul 4 at 13:58






@MohitRane, I am not using custom table, using sales_order_item table for loading collection

– jafar pinjar
Jul 4 at 13:58











4 Answers
4






active

oldest

votes


















1














can you please try this code



 <column name="created_on">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">dateRange</item>
<item name="sorting" xsi:type="string">asc</item>
<item name="label" xsi:type="string" translate="true">Created On</item>
</item>
<item name="sortOrder" xsi:type="number">2</item>
</argument>
</column>





share|improve this answer

























  • yes tried your code, its not working. "Something went wrong " error

    – jafar pinjar
    Jul 8 at 13:17











  • same error again, Grid is not loading

    – jafar pinjar
    Jul 8 at 13:20












  • updated the script please check now

    – nikunj
    Jul 8 at 13:20











  • It should be created_at is it? updated but still same issue, cleared cache and checked it "Bad Request"

    – jafar pinjar
    Jul 8 at 13:21












  • can you please check your model and field name for created at

    – nikunj
    Jul 8 at 13:23


















0














Try below code



<item name="dateFormat" xsi:type="string">MMM dd, yyyy, h:mm:ss a</item>


Instead of



 <item name="dateFormat" xsi:type="string">Y-MM-dd HH:mm:ss</item>





share|improve this answer























  • same error. nothing changed

    – jafar pinjar
    Jul 4 at 13:48











  • @jafarpinjar: after above changes, have you clear cache?

    – Balwant Singh
    Jul 4 at 13:51











  • yes, did the cache flush and checked it, I have one exception, Integrity constraint violation: 1052 Column 'created_at' in where clause is ambiguous at

    – jafar pinjar
    Jul 4 at 13:53











  • @jafarpinjar you mean now error is coming diffrent one to previous, right?

    – Balwant Singh
    Jul 5 at 5:33











  • @jafarpinjar: check one more thing your custom column 'created_at' should not unique key in your custom table.

    – Balwant Singh
    Jul 5 at 5:45


















0














EDIT



You can solve this by using addFilterToMap()




Add this code in your Collection.php file




protected function _construct()

parent::_construct();
$this->addFilterToMap(
'created_at',
'sales_order_item.created_at'
);



This code is working properly in my module



<column name="created_at" class="MagentoUiComponentListingColumnsDate">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">dateRange</item>
<item name="sorting" xsi:type="string">desc</item>
<item name="sortable" xsi:type="boolean">true</item>
<item name="dataType" xsi:type="string">date</item>
<item name="label" xsi:type="string" translate="true">Date</item>
<item name="dateFormat" xsi:type="string">Y-MM-dd HH:mm:ss</item>
<item name="sortOrder" xsi:type="number">1</item>
</item>
</argument>
</column>


You can try removing this line



<item name="component" xsi:type="string">Magento_Ui/js/grid/columns/date</item>





share|improve this answer

























  • Hello Mohit, used this code, its not working on page load itself error message showing like above, i cleared cache and checked it.

    – jafar pinjar
    Jul 8 at 6:30











  • Try this code <column name="created_at" class="MagentoUiComponentListingColumnsDate" component="Magento_Ui/js/grid/columns/date"> <settings> <filter>dateRange</filter> <dataType>date</dataType> <label translate="true">Created at</label> <sorting>desc</sorting> </settings> </column>

    – Mohit Rane
    Jul 8 at 6:37












  • yes same error again, gird not loading on page load..

    – jafar pinjar
    Jul 8 at 7:15











  • I think some error in xml code,

    – jafar pinjar
    Jul 8 at 7:31











  • can you share your listing.xml file ?

    – Mohit Rane
    Jul 8 at 7:33



















0














try with below code for UI Component



<column name="created_at" class="MagentoUiComponentListingColumnsDate">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">dateRange</item>
<item name="sorting" xsi:type="string">desc</item>
<item name="sortable" xsi:type="boolean">true</item>
<item name="dataType" xsi:type="string">date</item>
<item name="label" xsi:type="string" translate="true">Date</item>
<item name="dateFormat" xsi:type="string">Y-MM-dd HH:mm:ss</item>
<item name="sortOrder" xsi:type="number">1</item>
</item>
</argument>
</column>


please comment below line



<item name="component" xsi:type="string">Magento_Ui/js/grid/columns/date</item>


than update your Collection.php



protected function _construct()

parent::_construct();
$this->addFilterToMap(
'created_at',
'sales_order_item.created_at'
);



I hope its work for you.






share|improve this answer























  • hello @Anas, you mean here? Model/Resource/Products/Grid/Collection.php

    – jafar pinjar
    16 hours ago











  • yes, Note : try with your filter attributes. I mention here for just demo which done and working from my side.

    – Anas Mansuri
    16 hours ago











  • Its not working bro..

    – jafar pinjar
    14 hours ago











  • please refer this url - github.com/magento/magento2/issues/1724 , may be its very useful to you.

    – Anas Mansuri
    13 hours ago














Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f280834%2fdate-range-filter-not-working-in-custom-grid-magento-2%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























4 Answers
4






active

oldest

votes








4 Answers
4






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














can you please try this code



 <column name="created_on">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">dateRange</item>
<item name="sorting" xsi:type="string">asc</item>
<item name="label" xsi:type="string" translate="true">Created On</item>
</item>
<item name="sortOrder" xsi:type="number">2</item>
</argument>
</column>





share|improve this answer

























  • yes tried your code, its not working. "Something went wrong " error

    – jafar pinjar
    Jul 8 at 13:17











  • same error again, Grid is not loading

    – jafar pinjar
    Jul 8 at 13:20












  • updated the script please check now

    – nikunj
    Jul 8 at 13:20











  • It should be created_at is it? updated but still same issue, cleared cache and checked it "Bad Request"

    – jafar pinjar
    Jul 8 at 13:21












  • can you please check your model and field name for created at

    – nikunj
    Jul 8 at 13:23















1














can you please try this code



 <column name="created_on">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">dateRange</item>
<item name="sorting" xsi:type="string">asc</item>
<item name="label" xsi:type="string" translate="true">Created On</item>
</item>
<item name="sortOrder" xsi:type="number">2</item>
</argument>
</column>





share|improve this answer

























  • yes tried your code, its not working. "Something went wrong " error

    – jafar pinjar
    Jul 8 at 13:17











  • same error again, Grid is not loading

    – jafar pinjar
    Jul 8 at 13:20












  • updated the script please check now

    – nikunj
    Jul 8 at 13:20











  • It should be created_at is it? updated but still same issue, cleared cache and checked it "Bad Request"

    – jafar pinjar
    Jul 8 at 13:21












  • can you please check your model and field name for created at

    – nikunj
    Jul 8 at 13:23













1












1








1







can you please try this code



 <column name="created_on">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">dateRange</item>
<item name="sorting" xsi:type="string">asc</item>
<item name="label" xsi:type="string" translate="true">Created On</item>
</item>
<item name="sortOrder" xsi:type="number">2</item>
</argument>
</column>





share|improve this answer















can you please try this code



 <column name="created_on">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">dateRange</item>
<item name="sorting" xsi:type="string">asc</item>
<item name="label" xsi:type="string" translate="true">Created On</item>
</item>
<item name="sortOrder" xsi:type="number">2</item>
</argument>
</column>






share|improve this answer














share|improve this answer



share|improve this answer








edited Jul 8 at 13:18

























answered Jul 8 at 13:13









nikunjnikunj

1666 bronze badges




1666 bronze badges












  • yes tried your code, its not working. "Something went wrong " error

    – jafar pinjar
    Jul 8 at 13:17











  • same error again, Grid is not loading

    – jafar pinjar
    Jul 8 at 13:20












  • updated the script please check now

    – nikunj
    Jul 8 at 13:20











  • It should be created_at is it? updated but still same issue, cleared cache and checked it "Bad Request"

    – jafar pinjar
    Jul 8 at 13:21












  • can you please check your model and field name for created at

    – nikunj
    Jul 8 at 13:23

















  • yes tried your code, its not working. "Something went wrong " error

    – jafar pinjar
    Jul 8 at 13:17











  • same error again, Grid is not loading

    – jafar pinjar
    Jul 8 at 13:20












  • updated the script please check now

    – nikunj
    Jul 8 at 13:20











  • It should be created_at is it? updated but still same issue, cleared cache and checked it "Bad Request"

    – jafar pinjar
    Jul 8 at 13:21












  • can you please check your model and field name for created at

    – nikunj
    Jul 8 at 13:23
















yes tried your code, its not working. "Something went wrong " error

– jafar pinjar
Jul 8 at 13:17





yes tried your code, its not working. "Something went wrong " error

– jafar pinjar
Jul 8 at 13:17













same error again, Grid is not loading

– jafar pinjar
Jul 8 at 13:20






same error again, Grid is not loading

– jafar pinjar
Jul 8 at 13:20














updated the script please check now

– nikunj
Jul 8 at 13:20





updated the script please check now

– nikunj
Jul 8 at 13:20













It should be created_at is it? updated but still same issue, cleared cache and checked it "Bad Request"

– jafar pinjar
Jul 8 at 13:21






It should be created_at is it? updated but still same issue, cleared cache and checked it "Bad Request"

– jafar pinjar
Jul 8 at 13:21














can you please check your model and field name for created at

– nikunj
Jul 8 at 13:23





can you please check your model and field name for created at

– nikunj
Jul 8 at 13:23













0














Try below code



<item name="dateFormat" xsi:type="string">MMM dd, yyyy, h:mm:ss a</item>


Instead of



 <item name="dateFormat" xsi:type="string">Y-MM-dd HH:mm:ss</item>





share|improve this answer























  • same error. nothing changed

    – jafar pinjar
    Jul 4 at 13:48











  • @jafarpinjar: after above changes, have you clear cache?

    – Balwant Singh
    Jul 4 at 13:51











  • yes, did the cache flush and checked it, I have one exception, Integrity constraint violation: 1052 Column 'created_at' in where clause is ambiguous at

    – jafar pinjar
    Jul 4 at 13:53











  • @jafarpinjar you mean now error is coming diffrent one to previous, right?

    – Balwant Singh
    Jul 5 at 5:33











  • @jafarpinjar: check one more thing your custom column 'created_at' should not unique key in your custom table.

    – Balwant Singh
    Jul 5 at 5:45















0














Try below code



<item name="dateFormat" xsi:type="string">MMM dd, yyyy, h:mm:ss a</item>


Instead of



 <item name="dateFormat" xsi:type="string">Y-MM-dd HH:mm:ss</item>





share|improve this answer























  • same error. nothing changed

    – jafar pinjar
    Jul 4 at 13:48











  • @jafarpinjar: after above changes, have you clear cache?

    – Balwant Singh
    Jul 4 at 13:51











  • yes, did the cache flush and checked it, I have one exception, Integrity constraint violation: 1052 Column 'created_at' in where clause is ambiguous at

    – jafar pinjar
    Jul 4 at 13:53











  • @jafarpinjar you mean now error is coming diffrent one to previous, right?

    – Balwant Singh
    Jul 5 at 5:33











  • @jafarpinjar: check one more thing your custom column 'created_at' should not unique key in your custom table.

    – Balwant Singh
    Jul 5 at 5:45













0












0








0







Try below code



<item name="dateFormat" xsi:type="string">MMM dd, yyyy, h:mm:ss a</item>


Instead of



 <item name="dateFormat" xsi:type="string">Y-MM-dd HH:mm:ss</item>





share|improve this answer













Try below code



<item name="dateFormat" xsi:type="string">MMM dd, yyyy, h:mm:ss a</item>


Instead of



 <item name="dateFormat" xsi:type="string">Y-MM-dd HH:mm:ss</item>






share|improve this answer












share|improve this answer



share|improve this answer










answered Jul 4 at 13:46









Balwant SinghBalwant Singh

4191 gold badge3 silver badges16 bronze badges




4191 gold badge3 silver badges16 bronze badges












  • same error. nothing changed

    – jafar pinjar
    Jul 4 at 13:48











  • @jafarpinjar: after above changes, have you clear cache?

    – Balwant Singh
    Jul 4 at 13:51











  • yes, did the cache flush and checked it, I have one exception, Integrity constraint violation: 1052 Column 'created_at' in where clause is ambiguous at

    – jafar pinjar
    Jul 4 at 13:53











  • @jafarpinjar you mean now error is coming diffrent one to previous, right?

    – Balwant Singh
    Jul 5 at 5:33











  • @jafarpinjar: check one more thing your custom column 'created_at' should not unique key in your custom table.

    – Balwant Singh
    Jul 5 at 5:45

















  • same error. nothing changed

    – jafar pinjar
    Jul 4 at 13:48











  • @jafarpinjar: after above changes, have you clear cache?

    – Balwant Singh
    Jul 4 at 13:51











  • yes, did the cache flush and checked it, I have one exception, Integrity constraint violation: 1052 Column 'created_at' in where clause is ambiguous at

    – jafar pinjar
    Jul 4 at 13:53











  • @jafarpinjar you mean now error is coming diffrent one to previous, right?

    – Balwant Singh
    Jul 5 at 5:33











  • @jafarpinjar: check one more thing your custom column 'created_at' should not unique key in your custom table.

    – Balwant Singh
    Jul 5 at 5:45
















same error. nothing changed

– jafar pinjar
Jul 4 at 13:48





same error. nothing changed

– jafar pinjar
Jul 4 at 13:48













@jafarpinjar: after above changes, have you clear cache?

– Balwant Singh
Jul 4 at 13:51





@jafarpinjar: after above changes, have you clear cache?

– Balwant Singh
Jul 4 at 13:51













yes, did the cache flush and checked it, I have one exception, Integrity constraint violation: 1052 Column 'created_at' in where clause is ambiguous at

– jafar pinjar
Jul 4 at 13:53





yes, did the cache flush and checked it, I have one exception, Integrity constraint violation: 1052 Column 'created_at' in where clause is ambiguous at

– jafar pinjar
Jul 4 at 13:53













@jafarpinjar you mean now error is coming diffrent one to previous, right?

– Balwant Singh
Jul 5 at 5:33





@jafarpinjar you mean now error is coming diffrent one to previous, right?

– Balwant Singh
Jul 5 at 5:33













@jafarpinjar: check one more thing your custom column 'created_at' should not unique key in your custom table.

– Balwant Singh
Jul 5 at 5:45





@jafarpinjar: check one more thing your custom column 'created_at' should not unique key in your custom table.

– Balwant Singh
Jul 5 at 5:45











0














EDIT



You can solve this by using addFilterToMap()




Add this code in your Collection.php file




protected function _construct()

parent::_construct();
$this->addFilterToMap(
'created_at',
'sales_order_item.created_at'
);



This code is working properly in my module



<column name="created_at" class="MagentoUiComponentListingColumnsDate">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">dateRange</item>
<item name="sorting" xsi:type="string">desc</item>
<item name="sortable" xsi:type="boolean">true</item>
<item name="dataType" xsi:type="string">date</item>
<item name="label" xsi:type="string" translate="true">Date</item>
<item name="dateFormat" xsi:type="string">Y-MM-dd HH:mm:ss</item>
<item name="sortOrder" xsi:type="number">1</item>
</item>
</argument>
</column>


You can try removing this line



<item name="component" xsi:type="string">Magento_Ui/js/grid/columns/date</item>





share|improve this answer

























  • Hello Mohit, used this code, its not working on page load itself error message showing like above, i cleared cache and checked it.

    – jafar pinjar
    Jul 8 at 6:30











  • Try this code <column name="created_at" class="MagentoUiComponentListingColumnsDate" component="Magento_Ui/js/grid/columns/date"> <settings> <filter>dateRange</filter> <dataType>date</dataType> <label translate="true">Created at</label> <sorting>desc</sorting> </settings> </column>

    – Mohit Rane
    Jul 8 at 6:37












  • yes same error again, gird not loading on page load..

    – jafar pinjar
    Jul 8 at 7:15











  • I think some error in xml code,

    – jafar pinjar
    Jul 8 at 7:31











  • can you share your listing.xml file ?

    – Mohit Rane
    Jul 8 at 7:33
















0














EDIT



You can solve this by using addFilterToMap()




Add this code in your Collection.php file




protected function _construct()

parent::_construct();
$this->addFilterToMap(
'created_at',
'sales_order_item.created_at'
);



This code is working properly in my module



<column name="created_at" class="MagentoUiComponentListingColumnsDate">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">dateRange</item>
<item name="sorting" xsi:type="string">desc</item>
<item name="sortable" xsi:type="boolean">true</item>
<item name="dataType" xsi:type="string">date</item>
<item name="label" xsi:type="string" translate="true">Date</item>
<item name="dateFormat" xsi:type="string">Y-MM-dd HH:mm:ss</item>
<item name="sortOrder" xsi:type="number">1</item>
</item>
</argument>
</column>


You can try removing this line



<item name="component" xsi:type="string">Magento_Ui/js/grid/columns/date</item>





share|improve this answer

























  • Hello Mohit, used this code, its not working on page load itself error message showing like above, i cleared cache and checked it.

    – jafar pinjar
    Jul 8 at 6:30











  • Try this code <column name="created_at" class="MagentoUiComponentListingColumnsDate" component="Magento_Ui/js/grid/columns/date"> <settings> <filter>dateRange</filter> <dataType>date</dataType> <label translate="true">Created at</label> <sorting>desc</sorting> </settings> </column>

    – Mohit Rane
    Jul 8 at 6:37












  • yes same error again, gird not loading on page load..

    – jafar pinjar
    Jul 8 at 7:15











  • I think some error in xml code,

    – jafar pinjar
    Jul 8 at 7:31











  • can you share your listing.xml file ?

    – Mohit Rane
    Jul 8 at 7:33














0












0








0







EDIT



You can solve this by using addFilterToMap()




Add this code in your Collection.php file




protected function _construct()

parent::_construct();
$this->addFilterToMap(
'created_at',
'sales_order_item.created_at'
);



This code is working properly in my module



<column name="created_at" class="MagentoUiComponentListingColumnsDate">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">dateRange</item>
<item name="sorting" xsi:type="string">desc</item>
<item name="sortable" xsi:type="boolean">true</item>
<item name="dataType" xsi:type="string">date</item>
<item name="label" xsi:type="string" translate="true">Date</item>
<item name="dateFormat" xsi:type="string">Y-MM-dd HH:mm:ss</item>
<item name="sortOrder" xsi:type="number">1</item>
</item>
</argument>
</column>


You can try removing this line



<item name="component" xsi:type="string">Magento_Ui/js/grid/columns/date</item>





share|improve this answer















EDIT



You can solve this by using addFilterToMap()




Add this code in your Collection.php file




protected function _construct()

parent::_construct();
$this->addFilterToMap(
'created_at',
'sales_order_item.created_at'
);



This code is working properly in my module



<column name="created_at" class="MagentoUiComponentListingColumnsDate">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">dateRange</item>
<item name="sorting" xsi:type="string">desc</item>
<item name="sortable" xsi:type="boolean">true</item>
<item name="dataType" xsi:type="string">date</item>
<item name="label" xsi:type="string" translate="true">Date</item>
<item name="dateFormat" xsi:type="string">Y-MM-dd HH:mm:ss</item>
<item name="sortOrder" xsi:type="number">1</item>
</item>
</argument>
</column>


You can try removing this line



<item name="component" xsi:type="string">Magento_Ui/js/grid/columns/date</item>






share|improve this answer














share|improve this answer



share|improve this answer








edited 16 hours ago

























answered Jul 8 at 6:20









Mohit RaneMohit Rane

48213 bronze badges




48213 bronze badges












  • Hello Mohit, used this code, its not working on page load itself error message showing like above, i cleared cache and checked it.

    – jafar pinjar
    Jul 8 at 6:30











  • Try this code <column name="created_at" class="MagentoUiComponentListingColumnsDate" component="Magento_Ui/js/grid/columns/date"> <settings> <filter>dateRange</filter> <dataType>date</dataType> <label translate="true">Created at</label> <sorting>desc</sorting> </settings> </column>

    – Mohit Rane
    Jul 8 at 6:37












  • yes same error again, gird not loading on page load..

    – jafar pinjar
    Jul 8 at 7:15











  • I think some error in xml code,

    – jafar pinjar
    Jul 8 at 7:31











  • can you share your listing.xml file ?

    – Mohit Rane
    Jul 8 at 7:33


















  • Hello Mohit, used this code, its not working on page load itself error message showing like above, i cleared cache and checked it.

    – jafar pinjar
    Jul 8 at 6:30











  • Try this code <column name="created_at" class="MagentoUiComponentListingColumnsDate" component="Magento_Ui/js/grid/columns/date"> <settings> <filter>dateRange</filter> <dataType>date</dataType> <label translate="true">Created at</label> <sorting>desc</sorting> </settings> </column>

    – Mohit Rane
    Jul 8 at 6:37












  • yes same error again, gird not loading on page load..

    – jafar pinjar
    Jul 8 at 7:15











  • I think some error in xml code,

    – jafar pinjar
    Jul 8 at 7:31











  • can you share your listing.xml file ?

    – Mohit Rane
    Jul 8 at 7:33

















Hello Mohit, used this code, its not working on page load itself error message showing like above, i cleared cache and checked it.

– jafar pinjar
Jul 8 at 6:30





Hello Mohit, used this code, its not working on page load itself error message showing like above, i cleared cache and checked it.

– jafar pinjar
Jul 8 at 6:30













Try this code <column name="created_at" class="MagentoUiComponentListingColumnsDate" component="Magento_Ui/js/grid/columns/date"> <settings> <filter>dateRange</filter> <dataType>date</dataType> <label translate="true">Created at</label> <sorting>desc</sorting> </settings> </column>

– Mohit Rane
Jul 8 at 6:37






Try this code <column name="created_at" class="MagentoUiComponentListingColumnsDate" component="Magento_Ui/js/grid/columns/date"> <settings> <filter>dateRange</filter> <dataType>date</dataType> <label translate="true">Created at</label> <sorting>desc</sorting> </settings> </column>

– Mohit Rane
Jul 8 at 6:37














yes same error again, gird not loading on page load..

– jafar pinjar
Jul 8 at 7:15





yes same error again, gird not loading on page load..

– jafar pinjar
Jul 8 at 7:15













I think some error in xml code,

– jafar pinjar
Jul 8 at 7:31





I think some error in xml code,

– jafar pinjar
Jul 8 at 7:31













can you share your listing.xml file ?

– Mohit Rane
Jul 8 at 7:33






can you share your listing.xml file ?

– Mohit Rane
Jul 8 at 7:33












0














try with below code for UI Component



<column name="created_at" class="MagentoUiComponentListingColumnsDate">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">dateRange</item>
<item name="sorting" xsi:type="string">desc</item>
<item name="sortable" xsi:type="boolean">true</item>
<item name="dataType" xsi:type="string">date</item>
<item name="label" xsi:type="string" translate="true">Date</item>
<item name="dateFormat" xsi:type="string">Y-MM-dd HH:mm:ss</item>
<item name="sortOrder" xsi:type="number">1</item>
</item>
</argument>
</column>


please comment below line



<item name="component" xsi:type="string">Magento_Ui/js/grid/columns/date</item>


than update your Collection.php



protected function _construct()

parent::_construct();
$this->addFilterToMap(
'created_at',
'sales_order_item.created_at'
);



I hope its work for you.






share|improve this answer























  • hello @Anas, you mean here? Model/Resource/Products/Grid/Collection.php

    – jafar pinjar
    16 hours ago











  • yes, Note : try with your filter attributes. I mention here for just demo which done and working from my side.

    – Anas Mansuri
    16 hours ago











  • Its not working bro..

    – jafar pinjar
    14 hours ago











  • please refer this url - github.com/magento/magento2/issues/1724 , may be its very useful to you.

    – Anas Mansuri
    13 hours ago
















0














try with below code for UI Component



<column name="created_at" class="MagentoUiComponentListingColumnsDate">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">dateRange</item>
<item name="sorting" xsi:type="string">desc</item>
<item name="sortable" xsi:type="boolean">true</item>
<item name="dataType" xsi:type="string">date</item>
<item name="label" xsi:type="string" translate="true">Date</item>
<item name="dateFormat" xsi:type="string">Y-MM-dd HH:mm:ss</item>
<item name="sortOrder" xsi:type="number">1</item>
</item>
</argument>
</column>


please comment below line



<item name="component" xsi:type="string">Magento_Ui/js/grid/columns/date</item>


than update your Collection.php



protected function _construct()

parent::_construct();
$this->addFilterToMap(
'created_at',
'sales_order_item.created_at'
);



I hope its work for you.






share|improve this answer























  • hello @Anas, you mean here? Model/Resource/Products/Grid/Collection.php

    – jafar pinjar
    16 hours ago











  • yes, Note : try with your filter attributes. I mention here for just demo which done and working from my side.

    – Anas Mansuri
    16 hours ago











  • Its not working bro..

    – jafar pinjar
    14 hours ago











  • please refer this url - github.com/magento/magento2/issues/1724 , may be its very useful to you.

    – Anas Mansuri
    13 hours ago














0












0








0







try with below code for UI Component



<column name="created_at" class="MagentoUiComponentListingColumnsDate">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">dateRange</item>
<item name="sorting" xsi:type="string">desc</item>
<item name="sortable" xsi:type="boolean">true</item>
<item name="dataType" xsi:type="string">date</item>
<item name="label" xsi:type="string" translate="true">Date</item>
<item name="dateFormat" xsi:type="string">Y-MM-dd HH:mm:ss</item>
<item name="sortOrder" xsi:type="number">1</item>
</item>
</argument>
</column>


please comment below line



<item name="component" xsi:type="string">Magento_Ui/js/grid/columns/date</item>


than update your Collection.php



protected function _construct()

parent::_construct();
$this->addFilterToMap(
'created_at',
'sales_order_item.created_at'
);



I hope its work for you.






share|improve this answer













try with below code for UI Component



<column name="created_at" class="MagentoUiComponentListingColumnsDate">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">dateRange</item>
<item name="sorting" xsi:type="string">desc</item>
<item name="sortable" xsi:type="boolean">true</item>
<item name="dataType" xsi:type="string">date</item>
<item name="label" xsi:type="string" translate="true">Date</item>
<item name="dateFormat" xsi:type="string">Y-MM-dd HH:mm:ss</item>
<item name="sortOrder" xsi:type="number">1</item>
</item>
</argument>
</column>


please comment below line



<item name="component" xsi:type="string">Magento_Ui/js/grid/columns/date</item>


than update your Collection.php



protected function _construct()

parent::_construct();
$this->addFilterToMap(
'created_at',
'sales_order_item.created_at'
);



I hope its work for you.







share|improve this answer












share|improve this answer



share|improve this answer










answered 16 hours ago









Anas MansuriAnas Mansuri

9241 silver badge16 bronze badges




9241 silver badge16 bronze badges












  • hello @Anas, you mean here? Model/Resource/Products/Grid/Collection.php

    – jafar pinjar
    16 hours ago











  • yes, Note : try with your filter attributes. I mention here for just demo which done and working from my side.

    – Anas Mansuri
    16 hours ago











  • Its not working bro..

    – jafar pinjar
    14 hours ago











  • please refer this url - github.com/magento/magento2/issues/1724 , may be its very useful to you.

    – Anas Mansuri
    13 hours ago


















  • hello @Anas, you mean here? Model/Resource/Products/Grid/Collection.php

    – jafar pinjar
    16 hours ago











  • yes, Note : try with your filter attributes. I mention here for just demo which done and working from my side.

    – Anas Mansuri
    16 hours ago











  • Its not working bro..

    – jafar pinjar
    14 hours ago











  • please refer this url - github.com/magento/magento2/issues/1724 , may be its very useful to you.

    – Anas Mansuri
    13 hours ago

















hello @Anas, you mean here? Model/Resource/Products/Grid/Collection.php

– jafar pinjar
16 hours ago





hello @Anas, you mean here? Model/Resource/Products/Grid/Collection.php

– jafar pinjar
16 hours ago













yes, Note : try with your filter attributes. I mention here for just demo which done and working from my side.

– Anas Mansuri
16 hours ago





yes, Note : try with your filter attributes. I mention here for just demo which done and working from my side.

– Anas Mansuri
16 hours ago













Its not working bro..

– jafar pinjar
14 hours ago





Its not working bro..

– jafar pinjar
14 hours ago













please refer this url - github.com/magento/magento2/issues/1724 , may be its very useful to you.

– Anas Mansuri
13 hours ago






please refer this url - github.com/magento/magento2/issues/1724 , may be its very useful to you.

– Anas Mansuri
13 hours ago


















draft saved

draft discarded
















































Thanks for contributing an answer to Magento Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f280834%2fdate-range-filter-not-working-in-custom-grid-magento-2%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Grendel Contents Story Scholarship Depictions Notes References Navigation menu10.1093/notesj/gjn112Berserkeree

Area configuration aggregation error after install Porto themeMagento 2.1 CE Installed but front/backend not loading/workingCSS not loading on page within Magento 2 pageCannot install module in Magento 2no commands defined in the “setup” namespace. in Magento2Magento 2: Static files are present but shows 404Why do i have to always run the commands to clean cache in Magento 2.1.8?Failure reason: 'Unable to unserialize value.'Error 500 after magento migrationIn production mode the site does not loadMagento 2 : Error 500 after installing

Middle Expansion Olielle Resaix Definition: Uttering songs of triumph shouting with joy triumphant exulting Sejunction Journal 붙다 달 고급 품목 외출 The stretch trades the screeching tin. Definition: The act of speaking with a drawl a drawl Cough Sand Definition: An uproar a quarrel a noisy outbreak Shake Iron Publicize Horse House Baby 사과 Resaix Flaggy Jelly Temporary Unequaled Puppet A drop in the bucket Shrew 성격 회원 성질 미팅 The burn frames the tacky quality. Materialistic The smoke reduces the way. Yammoe Nondescript Cheek 얼굴 배 약하다 날리다 타다 The illegal country shows the iron. Help Rule Drearien Smoke Teaching Meaty Wasp Abraham Lincoln Jaws 진심 수리하다 Size Cork Idea Convert Think Lark John Lennon 거울 청소 군 추천하다 아이스크림