How can I sort a view based on a rewritten field? I have a view of a content type that contains two different date fields (one with date repeats and one multivalued single dates). Only one date field is filled out at any given time. In the view's display, I have combined the two fields by hiding the first date field and rewriting the second and including the replacement token of the first and second. Is there any way to now use the rewritten field to sort the view in ascending order based on this combined date field? It appears it sorts it based on the original value of the date field.

I have done my research and have only found old, somewhat-related, threads with dead-ends.

views sorting by rewritten field?

Table does not sort on rewritten field, but on original field

Views: custom field for sort criteria

Sort by global:custom text. Is it possible?

I was hoping there is a new or sneaky way of making this happen.
If you don't want to go for the module route, this is one alternative:

1) install Computed Field module
2) add a computed field to your content type
3) in the field settings, in the Computed code (PHP) textarea, you can access the field data. 

Get your date fields in your current langugage to a variable.

$repeating_dates = field_get_items($entity_type, $entity, 'field_repeating_date_example');
$multidates = field_get_items($entity_type, $entity, 'field_multidate_example');


Your date values can now be found in

$repeating_dates[0]['value'],
$repeating_dates[1]['value'],
$repeating_dates[2]['value'], etc.

$multidates[0]['value'],
$multidates[1]['value'],
$multidates[2]['value'], etc.


Do whatever logic you need with your date fields and assign the result to 

$entity_field[0]['value']


Now you have a sortable field you can use in views, but first you have to update all the nodes as the computed field will only be computed and saved to the database at node save. There are many ways to do this, one is using Views Bulk Operations, it gives you an option to re-save nodes at admin/content.