Putting aside the common misconception that people ever believed the earth was flat (this seems to have become popular during the 19th century, they loved to exaggerate the middle ages)
Isn't say that it's a misconception that "people ever believed the earth was flat" a bit of a hasty generalization? While it is a myth to say that everyone in the Middle Ages or earlier eras believed the earth was flat, it's also just as false to say that no one believed the earth was flat.
Much like evolution vs. creationism, belief that the earth was a sphere seems to have been very common in more educated people, while belief that it was a flat disc seems to have been found in less educated or merely religiously educated people (biblical descriptions of the earth are most consistent with the flat disc view, with Jerusalem thought to be located at the center of the flat circle). However, since the educated group were also the scholars who wrote any books that survived until present time, it can give the false impression that basically everyone then believed in a spherical earth. But even in the scholarly ranks, there were still some who argued for a flat earth (ex. Lactantius and Cosmas Indicopleustes) so, even if that was a minority viewpoint in the educated ranks, it still means that not everyone believed in a spherical earth.
The only thing that's difficult to find out is when did belief in the spherical earth become commonplace with everyone and not just the educated people.