Initial Sort Order: Date is alphabetical

  • Cyclamate
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 3
  • Thank you received: 0

Cyclamate created the topic: Initial Sort Order: Date is alphabetical

I am trying to sort my lists by date. Instead of taking months and/or years into account it simply sorts by the day of the month. (for example, 10th of August would be sorted as being earlier than 20th of Februari, but later than 5th of November)

The data field in question has:
Label: Date
Type: Calendar
Format: %d.%m.%Y
Transfer Format: dd.mm.YYYY

I would like the sorting to take year, then month, then day into account, regardless of their order of display.

any help would be greatly appreciated.
#148685
  • Cyclamate
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 3
  • Thank you received: 0

Cyclamate replied the topic: Initial Sort Order: Date is alphabetical

With the start of a new year, this issue that was never solved has reared it's head once again and became much more troublesome than before. I'm afraid I can no longer simply ignore this issue, my proposal for a workaround in which I were to change the display order of the dates to YYYY-mm-dd was turned down by my client.

I still have no idea why the values are being treated as alphanumerical values, rather than a date format and any help would be greatly appreciated.
#161096
  • Posts: 52
  • Thank you received: 0

Venexian replied the topic: Initial Sort Order: Date is alphabetical

I have the same problem. Hope this bug will be solved soon.
Thank you
#161105
  • Posts: 52
  • Thank you received: 0

Venexian replied the topic: Initial Sort Order: Date is alphabetical

Hi Cyclamate,
sorry for the delayin sharing my solution with you and the group.
Here is my solution:

Label: Date
Type: Calendar
Format: %d/%m/%Y
Transfer Format: YYYY/mm/dd

In Item wrap code add the following php code:
<?php $value = substr($value, 8, 2) . '/' . substr($value, 5, 2) . '/' . substr($value, 0, 4); ?>

The sort will be done on what's in the field (YYYY/mm/dd) but you'll see the date in the format you need.
HTH
Venexian
#170464
Moderators: tomeperica
Time to create page: 0.091 seconds

New Icon Packs Category!

Crosstec is now offering icon packs.

If you are a paying subscriber, icon packs are automatically added to your account.

Check out our icon packs page!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Summer Sale!

50% discount on all of our extension subscription plans, templates and icon packs!

Get Your Subscription Here

News and Updates

Get informed about new downloads, updates and more in our News and Updates newsletter.

All Extensions Subscription

Get 1 year access to all of our current and future products and 1 year of professional support -- 99 for just 49! (Summer Sale)

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, Joomla!® templates for the duration of your membership. This means, by purchasing an All Extensions Subscription you'll have it all covered!

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here