[Skip to main content](#vessel-content)

#   Sort on date

##

- **[mrdan](/forum/user/3459-mrdan "View mrdan's Profile")**
- [![mrdan's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/3459-mrdan "View mrdan's Profile") Topic Author
- [ Offline](/forum/user/3459-mrdan)

Less More

- Posts: 38
- Thank you received: 0
-
-

14 years 6 months ago [\#49054](#49054) by [mrdan](/forum/user/3459-mrdan "View mrdan's Profile")  *[Sort on date](/forum/2-general-talk-about-hikashop/49054-sort-on-date#49054 "When I attempt to sort on date, the sorting does not work correctly.  I have a custom field called &quot;start date&quot;, and it is of type &quot;date&quot;. So when sorting from first to last, it sorts correctly for the month portion of the date field, but the day field does not sort properly. For instance, 3 shopping cart items could have dates of 5/2/2012, 5/18/2012, and 5/19/2012, but when sorted, it displays as 5/18/2012, 5/19/2012, 5/2/2012. The sorting algorithm thinks that 5/2/2012 if after 5/19/2012 since it thinks that &quot;2&quot; is greater than &quot;19&quot; (it thinks the 2 should come after 19).  For URL example see   www.rocksolidresults.com/nhcrafts/course...ting&amp;Itemid=561&amp;cid=  Is there a fix for this?  Thank you for your help.")* was created by *[mrdan](/forum/user/3459-mrdan "View mrdan's Profile")*

When I attempt to sort on date, the sorting does not work correctly.

I have a custom field called "start date", and it is of type "date". So when sorting from first to last, it sorts correctly for the month portion of the date field, but the day field does not sort properly. For instance, 3 shopping cart items could have dates of 5/2/2012, 5/18/2012, and 5/19/2012, but when sorted, it displays as 5/18/2012, 5/19/2012, 5/2/2012. The sorting algorithm thinks that 5/2/2012 if after 5/19/2012 since it thinks that "2" is greater than "19" (it thinks the 2 should come after 19).

For URL example see [ www.rocksolidresults.com/nhcrafts/course...ting&amp;Itemid=561&amp;cid=](https://www.rocksolidresults.com/nhcrafts/courses/index.php?option=com_hikashop&ctrl=category&task=listing&Itemid=561&cid=)

Is there a fix for this?

Thank you for your help.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzQ5MDU0LXNvcnQtb24tZGF0ZT90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[mrdan](/forum/user/3459-mrdan "View mrdan's Profile")**
- [![mrdan's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/3459-mrdan "View mrdan's Profile") Topic Author
- [ Offline](/forum/user/3459-mrdan)

Less More

- Posts: 38
- Thank you received: 0
-
-

14 years 6 months ago [\#49055](#49055) by [mrdan](/forum/user/3459-mrdan "View mrdan's Profile")  Replied by *[mrdan](/forum/user/3459-mrdan "View mrdan's Profile")* on topic *[Re: Sort on date](/forum/2-general-talk-about-hikashop/49054-sort-on-date#49055 "When I attempt to sort on date, the sorting does not work correctly.  I have a custom field called &quot;start date&quot;, and it is of type &quot;date&quot;. So when sorting from first to last, it sorts correctly for the month portion of the date field, but the day field does not sort properly. For instance, 3 shopping cart items could have dates of 5/2/2012, 5/18/2012, and 5/19/2012, but when sorted, it displays as 5/18/2012, 5/19/2012, 5/2/2012. The sorting algorithm thinks that 5/2/2012 if after 5/19/2012 since it thinks that &quot;2&quot; is greater than &quot;19&quot; (it thinks the 2 should come after 19).  For URL example see   www.rocksolidresults.com/nhcrafts/course...ting&amp;Itemid=561&amp;cid=  Is there a fix for this?  Thank you for your help.")*

URL example [ www.rocksolidresults.com/nhcrafts/course...ng&amp;Itemid=561&amp;cid=28](https://www.rocksolidresults.com/nhcrafts/courses/index.php?option=com_hikashop&ctrl=category&task=listing&Itemid=561&cid=28)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzQ5MDU0LXNvcnQtb24tZGF0ZT90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86323
- Thank you received: 14284
-
-

14 years 6 months ago [\#49131](#49131) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Sort on date](/forum/2-general-talk-about-hikashop/49054-sort-on-date#49131 "When I attempt to sort on date, the sorting does not work correctly.  I have a custom field called &quot;start date&quot;, and it is of type &quot;date&quot;. So when sorting from first to last, it sorts correctly for the month portion of the date field, but the day field does not sort properly. For instance, 3 shopping cart items could have dates of 5/2/2012, 5/18/2012, and 5/19/2012, but when sorted, it displays as 5/18/2012, 5/19/2012, 5/2/2012. The sorting algorithm thinks that 5/2/2012 if after 5/19/2012 since it thinks that &quot;2&quot; is greater than &quot;19&quot; (it thinks the 2 should come after 19).  For URL example see   www.rocksolidresults.com/nhcrafts/course...ting&amp;Itemid=561&amp;cid=  Is there a fix for this?  Thank you for your help.")*

The fix is to edit your custom field and change the date format in order to have the year first, then the month and the day at the end.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzQ5MDU0LXNvcnQtb24tZGF0ZT90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.065 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
