Dinner originally meant "breakfast". It comes from the Old French disner, which ultimately comes from the Latin *disjejunare, from dis- 'undo' + jejunare 'to fast'. Over the centuries, the meal shifted later and later in the day until it came to mean (usually) the last meal of the day.
Interestingly, all the names of meals in French come from this same root. At some point the word was reformed as déjeuner, still meaning "to break one's fast", but this again shifted later in the day and became lunch. Then breakfast became petit déjeuner.