ForMaTTiNG issues - d-m-y - d/m/y

Hi, I’ve had a quick look around the forum for specific details in and arround Formatting.

As you can see the due date field - the first entry is formatted different to the rest of them and that’s just because of the sort asc/desc order.

If i change the order from asc - to desc the bottom row 1st monthly call will then present with the datetime formatting with the slashes and not the hyphens? What am i doing wrong? Is there a variable conflicting somewhere that i could have undoubtedly set?

I have noticed this as well for tasks in activities subpanel
Screenshot from 2023-04-17 15-37-54

It would be really helpful to know which versions are these.

If there isn’t an Issue for this on Github yet, it would also be a good idea to open one.

1 Like

SuiteCRM Version 7.13.2
MySQL 5.7
Sugar Version 6.5.25 (Build 344)
PHP Version 7.4.33
Chrome Version;
Version 112.0.5615.121 (Official Build) (64-bit)
Brave Version
Version 1.50.119 Chromium: 112.0.5615.121 (Official Build) (64-bit)

My suite version initially started lower - I’ve fed upgrade packages through the wizard and it’s now at 7.13.2

Also may be handy to note that if i switch up the options with re formatting to different structures - or /'s it’s still a bit buggy on it’s output, but only on it’s top line I’ve noticed.

What I find very odd about this bug is how it affects only the first row… :thinking:

HI @dhuntress

You may have fixed this already?

So @dhuntress - I guess you must have made a code change, otherwise it would not be possible for you to change date-order: which you are able to do:

If i change the order from asc - to desc the bottom row 1st monthly call will then present with the datetime formatting with the slashes and not the hyphens?

Because: the Activities panel is broken in and has been for many versions: Sorting on the Due_Date column is broken - nothing happens when it is clicked.

This can be confirmed on the latest V14 demo at

The latest V8 demo - appears to be even more broken - in the Activities panel, there are NO dates showing under Due_Date.

Yes i fixed it by tweaking the code - you can also sneak in a sort order clause in the code too.

In the ForActivities.php file the due date column is calling an invalid column name - it’s supposed to be date_due not date_end - which is what’s in the default files from the repo.

You can get the due date to show in the activities by doing the following

go to public/legacy/modules folder.

Find all the ForActivities.php files.

There’s one in Tasks, one in Calls and one in Meetings

Copy these files to the respective /custom/modules folder in the legacy folder.

so there should be

Edit the ForActivities.php files in the custom directories and change the following

'date_end' => [
        'vname' => 'LBL_LIST_DUE_DATE',
        'width' => '10%',
        'alias' => 'date_end',
        'sort_by' => 'date_end',


'date_end' => [
        'vname' => 'LBL_LIST_DUE_DATE',
        'width' => '10%',
        'alias' => 'date_due',
        'sort_by' => 'date_due',

This will then present the due date as normal for the subpanels.

The same principle applies to ForHistory.php - as that won’t show you the due date either :slight_smile:


Does your code change above make the Sort column work? That code explanation is very helpful and clear - it will help MANY people to know about that fix. It looks like you have proved it to work in both V7 and V8 ?

If you were to post a short article to the forum: Show and Tell - it would help many people: eg with a title:

  • The History Panel fails to Sort by Date - the easy solution: for V7 and V8

It does change the sort column yes - But it sets it at a default level
When the record is loaded the sort order is already there - leaving the user not needing to toggle sort.

Actually your code DOES NOT work.
And also- your code changes are ALREADY standard SuiteCRM code since 2019.

Yet Activity sub-panel still fails to sort by Due Date -as it puts Meetings above Calls - no matter what the dates on them.

That’s what happens in the V14 live demo I just checked.

And yes, like your instance -the page opens with the subPanel in Date order - except that (as I said above) all Meetings are always above all calls.

And has the extra Bug -that the date_Due for Meetings is the END_Date not the start_Date.

It can be solved - easily!
I took 90 minutes offline and wrote a Show and Tell to show the Solution:

1 Like