Finding Gaps in Date Ranges Given a list of date ranges r as input, output or return any ranges not found in r.
For the sake of this example, input will be in YYYY-MM-DD format.
Let's say you have three date ranges:
[2019-01-01, 2019-02-01]
[2019-02-02, 2019-04-05]
[2019-06-01, 2019-07-01]

You can see that there is a gap in between 2019-04-05 and 2019-06-01.
The output will be that gap: [2019-04-06, 2019-05-31]
Rules

Input and output can be in any reasonable date or collection format, as long as it is consistent.
Assume the input is not ordered.
Your date range does not have to be [latest, earliest], but it does have to follow rule 2.
Assume there are no overlapping dates in the input

Test Cases:
Input: [[2019-01-01, 2019-02-01],[2019-02-02, 2019-04-05],[2019-06-01, 2019-07-01]]
Output: [[2019-04-06, 2019-05-31]]

Input: [[2019-01-01, 2019-02-01],[2018-02-02, 2018-04-05],[2019-06-01, 2019-07-01]]
Output: [[2018-04-06, 2018-12-31], [2019-02-02, 2019-05-31]]

Input: [[2019-01-01, 2019-02-01],[2019-02-02, 2019-03-02],[2019-03-03, 2019-07-01]]
Output: []

Input: [[2019-01-01, 2019-02-01], [2019-11-02, 2019-11-20]]
Output: [[2019-02-02, 2019-11-01]]

Input: [[2019-01-01, 2019-02-01],[2019-02-03, 2019-04-05]]
Output: [[2019-02-02, 2019-02-02]] or [[2019-02-02]]
APL (Dyalog Extended), 28 25 24 bytes



Anonymous tacit prefix function. Argument and result are 2-column matrices of day numbers since an epoch, each row representing a range.

1 ¯1+⍤1∘{⍵⌿⍨1&lt;-⍨/⍵}1⌽⍢,∧


Try it online! The In pre-processor function converts from a list of pairs of 3-element lists (dates in ISO order) to a 2-column matrix of IDNs, International Day Numbers (days since 1899-12-31). The Out post-processor function converts from a matrix of IDNs to a matrix of 3-element lists.

∧ sort rows ascending

1⌽ cyclically rotate the dates one step left
 ⍢, while ravelled (flattened) — afterwards, reshape back to original shape

1 ¯1+ add one and negative one
⍤1 using that list for each row
∘ of the result of
{…} the following lambda:
 ⍵ the argument
 -⍨/ subtract left-hand date from right-hand date, row-wise
 1&lt; mask where differences exceed one (i.e. where ranges are not adjacent)
 ⍵⌿⍨ filter the rows by that mask