Changing these two functions into one function
You need to think about the underlying model. Have a think about isA/hasA. Depending on what you conclude...


Are the types defining similar interfaces? You may find that the date info is like a label that both object types have attached to them. (It looks that way.) Define an interface that contains the common names. Have each of the two types implement it. Now you can use just one loop.
Is one of them actually a member of the other? Then define it that way. Your loop will get smaller.


Bottom line is that highly repetitive code should make you think about whether your model is correct.