I have a Newsroom page that combines "In the News" channel entries and "Press Release" channel entries and I need to sort by different dates. Press Releases use the entry_date because they go live on a specific date. In the News entries have their own pub_date date field since article publication dates might not necessarily align when the article is posted to the site (entry_date). While I could use entry_date for In the News entries, in the future an Events channel field will be added and included in this list. Events can't use the entry_date because they need to be listed on the site much earlier, however, the request is to have the date listed and sorted by be the event start date.
Is there a way to sort entries by multiple dates like this? I tried:
{exp:channel:entries channel="in_the_news|press_releases" orderby="pub_date|entry_date" sort="desc"}
but the entries listed all In the News article sorted by pub_date then all the Press Releases sorted by entry_date, not a mix of the two sorted by pub_date is ones existed then entry_date it not.
UPDATE:
Current code based on @stuartmcd69's answer below.
{exp:stash:set_list name="newsroom" parse_tags="yes"}
{exp:channel_entries channel="in_the_news|press_releases" dynamic="no"}
{!-- create stash variables --}
{stash:news-article_title}{news-article_title}{/stash:entry_title}
{stash:news-publication_name}{news-publication_name}{/stash:entry_title}
{stash:pr-title}{pr-title}{/stash:entry_title}
{!-- capture dates from both channels and convert to a universal date variable --}
{stash:universal_date}
{exp:switchee variable="{channel_short_name}" parse="inward"}
{!-- News Article dates --}
{case value="in_the_news"}
{news-publication_date}
{/case}
{!-- Press Release dates --}
{case value="press_release"}
{entry_date}
{/case}
{/exp:switchee}
{/stash:universal_date}
{/exp:channel_entries}
{/exp:stash:set_list}
<dl id="news_list" class="dl-horizontal">
{exp:stash:get_list name="newsroom" orderby="universal_date" sort="desc"}
{!-- Display entry based on channel name --}
{switchee variable="{channel_short_name}" parse="inward"}
{!-- News Articles --}
{case value="in_the_news"}
<div class="news_item in_the_news year-{year}">
<dt>
<h4>{news-publication_date format="%F %j, %Y"}</h4>
</dt>
<dd>
<h4><a href="{news-link_to_article}" target="_blank">{news-article_title}</a></h4>
<p>{news-publication_name}, {news-publication_date format="%F %j, %Y"}</p>
</dd>
<hr />
</div>
{/case}
{!-- Press Releases --}
{case value="press_releases"}
<div class="news_item press_releases year-{year}">
<dt>
<h4>{entry_date format="%F %j, %Y"}</h4>
</dt>
<dd>
<h4><a href="{page_uri}">{pr-title}</a></h4>
</dd>
<hr />
</div>
{/case}
{/switchee}
{/exp:stash:get_list}
</dl>