Q:

Comparing and converting multiple arrays

In an app i'm logging click events per day per user and i'd like to visualize them with d3. 
The line chart shows a line for every user. y-axis is the sum of clicks and x-axis is the day.
On some days users do not use the app so there's no data for that day.
But d3 demands that all arrays are of the same length and contain the same data structure. how can i fill the gaps efficiently?
Example data:
user01: [[01.Jun, 54],[02.Jun, 32], [05.Jun, 14], [07.Jun, 87]]
user02: [[01.Jun, 89],[02.Jun,  4], [03.Jun, 93], [05.Jun, 23], [06.Jun, 57]]
user03: [[03.Jun, 57],[06.Jun, 11], [07.Jun, 45]]

Should be converted to:
user01: [[01.Jun, 54],[02.Jun, 32], [03.Jun,  0], [05.Jun, 14], [06.Jun,  0], [07.Jun, 87]]
user02: [[01.Jun, 89],[02.Jun,  4], [03.Jun, 93], [05.Jun, 23], [06.Jun, 57], [07.Jun,  0]]
user03: [[01.Jun,  0],[02.Jun,  0], [03.Jun, 57], [05.Jun,  0], [06.Jun, 11], [07.Jun, 45]]

Sometimes there is no click event on a certain day, in this example on the 04.Jun no user was online so that data is not needed.
My idea would be to... 
1.) generate an array of all occuring unique x-values [01.Jun, 02.Jun, 03.Jun, 05.Jun, 06.Jun, 07.Jun] 
2.) check for every users' array if there is an entry for that day 
3.) if not than create an entry with 0.
Since the data is live updated and the number of users is variable: Is there an efficient way to do that, preferably with ramda?
Thanks for your help!
Muff
EDIT: The Days are Date Objects

A:

This is not the most efficient solution, but I consider it idiomatic Ramda code:
//  data Day = Mon | Tue | Wed | Thu | Fri | Sat | Sun
//
//  Day satisfies Ord, the class of orderable types.
const Mon = 1;
const Tue = 2;
const Wed = 3;
const Thu = 4;
const Fri = 5;
const Sat = 6;
const Sun = 7;

//    days :: Array Day
const days = [Mon, Tue, Wed, Thu, Fri, Sat, Sun];

//    defaultPairs :: Pair Day Integer
const defaultPairs = R.map(day => [day, 0], days);

//    fillGaps :: Array (Pair Day Integer) -> Array (Pair Day Integer)
const fillGaps = pairs => {
  const toInsert = R.differenceWith(R.eqBy(R.head), defaultPairs, pairs);
  return R.sortBy(R.head, R.concat(pairs, toInsert));
};

fillGaps([[Mon, 54], [Tue, 32], [Fri, 14], [Sun, 87]]);
// => [[1, 54], [2, 32], [3, 0], [4, 0], [5, 14], [6, 0], [7, 87]]

