When I was visiting my family's farm in Norway (Sogne og fjordane county) Middag, the big meal of the day, was always served at what I considered lunchtime. Then, in the evening we had kveldsmat which usually consisted of what I tend to think of as lunch type stuff. But in Oslo & Bergen Middagen was around what I considered typical dinner times.
Time didn't seem as important as the quantity of food & preparation involved.
In norway is common to eat dinner at 4-6pm, that is because usually they wake up early compared to another countries, lunch is earlier too, (around 10-12), anyway not everyone has the same times. There's even a small meal, similar to breakfast (kveldsmat) which is eaten around 10-11pm for those who has to wake up later
"Middag" is an evening or late afternoon meal, and the equivalent of dinner. It's the main meal of the day.
Historically, people would have their "middag" earlier, as they got up early to milk the cows and work the fields, and thus needed a hearty meal around noon, but that is no longer the case.
"Lunsj" would be lunch.