Function to turn date into array index
Merging with remote