Sorting date column having different format

Hi, I have a datagrid 1 having a trx date column. This trx date shall be presented in 2 ways: either month or day precision according to the status of the transaction. However the grid shall be sortable by trx date as well. Originally, I applied a new attribute with string type and ensure to update this attribute based on the trx date and status. This string attribute is presented in the datagrid. This is fine for presentation, but raises an issue regarding the sorting. By means of String type the sorting produces an unacceptable results, since sorting for this date should produce an order in which the day-precision value is sorted by day followed by the month-precision date values follow – repeated by each month. Is there any idea to solve this issue? For example, any technique to catch and override the sorting events, or using a JS to convert the day precision date to month-precision when it is required. Or...? I am looking forward to your solution. Note: - Datagrid 2 is not option to apply.
1 answers

Adding a third attribute, similar to you second attribute, but of a type that you need for the correct sorting.