In a legend about the prosperous era of Yao and Shun some 4000 years ago, when Yao was the king, he created many benefits for the people and was loved by them. However, since his son was not as capable as him, Yao did not pass on his throne to his son but to Shun, a wise and saintly man. Yao said to Shun: "You must pass the throne to a right person. Then I will feel at peace when I die." Shun passed his throne to Yu, who was a hero because he could control flooding. Just like Shun, Yu also did a lot of good deeds for the people and was revered by them. After Yao died, Shun set the day he made sacrifices to the heavens and gods, as well as to the late Yao, as the first day of the year, and the first day of the 1st lunar month became known as Yuan Dan or Yuan Zheng. This was Yuan Dan in ancient times. Previous dynasties would organize celebrations and sacrifices on Yuan Dan, for example sacrificing to the immortals and their forefathers, writing Spring Festival scrolls, writing character fortunes and dragon dancing.
People also celebrated the day by making sacrifices to immortals and ancestors, pasting spring festival scrolls onto their houses, setting off firecrackers, staying up all night, eating dinners at reunions as well as putting on a "society fire". These scenes are of such impact that the poet Xin Lan in the Jin Dynasty immortalised the scenes of Yuan Dan in his poem Yuan Zheng.