How to add a new field in the list view of case module:
show different DateTime between date_modified and now.
so the user knows how long the case does not update easily.
I know it can be achieved by workflow, but I don’t want the database to keep read and write. Can I make the different date show on the list view and doesn’t need to store in the database? and how to achieve it?
sorry, I don’t get what you mean. I still prefer not to install anything yet.
Maybe can add some custom code in listviewdef.php like the image I attached.
But I dunno how to write, so it can calculate the different DateTime with now and date_modified.
My code:
{$DATE_MODIFIED} can display the date modified of the cases, but
{$now_date} can’t display current DateTime.
The function already provided(outright_get_duration), so no need to install anything. This function takes 2 parameters in date , calculate its difference and return difference in Year,month,day , hours , mins. Is that not what you need?
However, I am not sure it will perform that calculation in the custom_code field.
You can copy that code to any function utils file and you can use “function” parameter in vardef as well. Both process and function parameter should work.