Sort merged array by array value in Twig? I have two Instagram API responses that I want to merge, by the photo's created_time. Is there a way to do that in Twig?

Right now I am just using this

{% set instagram = &lt;data&gt; %}
{% set community = &lt;data&gt; %}
{% set feed = instagram|merge(community) %}

    {% for photo in feed %}
        &lt;img src="{{photo.images.low_resolution.url}}" alt=""&gt;
        &lt;br /&gt;
    {% endfor %}


Each photo has a created_time string that I'd like to sort the array by, is that possible without creating a custom Twig extension? 

The sortByField plugin looked promising and sort of what I want, but it was directly aimed at Craft entry manipulation. Is there anything hacky that could be done?
The SuperSort Plugin is built for use cases exactly such as this. It allows you to render each object in your array using a Twig object template and sort the array based on the rendered value.

For example, in OP's case, we could sort the combined array by the created_time variable like this:

...
{% set feed = instagram|merge(community) %}
{% set sortedFeed = feed | supersort('sortAs', '{created_time}') %}


(The plugin parses {created_time} &mdash; a Craft 'micro-template' &mdash; into {{object.created_time}}, which provides the value by which the array is sorted.)

If the property of interest happened to be different between two arrays, we could include a conditional or ternary operator in the micro-template to differentiate them:

{% set sortedFeed = feed | supersort('sortAs', '{{ object.current_time is defined ?: object.someOtherProperty }}') %}