From a professional standpoint, it doesn't matter how or when calories are consumed as to how they impact the body. Regardless of whether you eat at 4pm or 11pm the calories will be digested by the body the same. A calorie is a calorie! Viewing caloric intake continuously is important. Remember that weight gain and weight loss occur over a period of time and is based on the average amount of calories taken in over a period of multiple days.
On the other hand: Most individuals are more active throughout the day than they are after 7pm. The more activity you do, the more calories you burn. So the thought process behind this clause is that you will burn more calories if you stop eating before 7pm because you are more active before 7pm than you are after. Typically people who eat at 10pm will go to bed soon after, leading to no activity and no oppportunity for caloric burn.
Overall, everything comes down to being aware of your caloric intake throughout the day and budgeting yourself for the foods you want to eat. Staying active and listening to your body cues is the best way to learn about your body and give it what it needs to be the healthiest possible.