Joel 2:11
9 They rush into the city; they scale its walls. They climb up into the houses; they go in through the windows like a thief. 10 The earth quakes before them; the sky reverberates. The sun and the moon grow dark; the stars refuse to shine. 11 The voice of the Lord thunders as he leads his army. Indeed, his warriors are innumerable; Surely his command is carried out! Yes, the day of the Lord is great and terrible42—who can survive it? 12 “Yet even now,” the Lord says, “return to me with all your heart—with fasting, weeping, and mourning. 13 Tear your hearts, not just your garments.” Return to the Lord your God, for he is merciful and compassionate, slow to anger and boundless in loyal love—often relenting from calamitous punishment.
Malachi 4:5
3 You will trample on the wicked, for they will be like ashes under the soles of your feet on the day that I am preparing,” says the Lord of Heaven’s Armies. 4 “Remember the law of my servant Moses, to whom at Horeb I gave rules and regulations for all Israel to obey. 5 Look, I will send you Elijah the prophet before the great and terrible day of the Lord arrives. 6 He will turn the hearts of the fathers to the sons, and the hearts of the sons to their fathers10, so that I will not come and strike the earth with judgment.”
Notes and References
"... Unlike most other prophets, Elijah had been successful. Through his instrumentality, Israel had turned to Yahweh and away from Ba'al. As a result, the writer of Malachi 3:23-24 [4:5-6] is sanguine that Elijah might again act to enable reconciliation, just as he is sanguine that (some of?) the people will respond positively to the appearance of Elijah as had Israelites a half millennium earlier. Malachi 3:23 [4:5] also provides a temporal context for the appearance of "the prophet." We are not told how soon Eliyah will arrive, but we do know that he will come before the yom Yahweh. The author creates this clause using language extant in another prophetic book, Joel 2:31 (and Joel 2:11). There, in a text that attests to the return of prophecy before Yahweh's day, an early Persian-period author claims that certain meteorological phenomena will presage that day. In Malachi, Elijah appears, substituting the sun turning to darkness and the moon to blood. Why? The person who composed the epilogue is anxious to address the question, raised in Malachi 3:2, of who will be able to survive the day and by what means. Malachi 3:24 [4:6] provides an answer, namely, that fathers and sons, reconciled through the agency of Elijah, will be able to survive the terrible day of Yahweh ..."
Petersen, David L. Zechariah 9-14 and Malachi: A Commentary (pp. 230-231) Westminster John Knox Press, 1995