Zechariah 8:19

Thus saith the LORD of hosts; The fast of the fourth month, and the fast of the fifth, and the fast of the seventh, and the fast of the tenth, shall be to the house of Judah joy and gladness, and cheerful feasts; therefore love the truth and peace.

The verse belongs to a prophecy given during the restoration from Babylon, in its first eight chapters concerning the reformation among God's people under Zerubbabel in the time of Haggai.
That prophecy chiefly presents visions to encourage confidence and earnest effort, typifies future reformations, indicates by figures and symbols the nations and God's power to save, and looks forward to the final glorious restoration when Christ comes.
The fourth month of the sacred Jewish year is called Thammuz.
The four fasts commemorate successive events connected with Jerusalem's fall: the fast of the tenth month recalls the beginning of the siege, and the fast of the fourth month recalls the capture of Jerusalem by Nebuchadnezzar and the breach in its wall.
The fast of the fifth month recalls the burning of the temple and other buildings, including the destruction of the first and second temples, and the fast of the seventh month recalls the murder of Gedaliah, governor of the remnant, which ended the last remnant of Judah's government in the land.

The fasts were kept during the captivity to mourn those calamities, defeats, afflictions, and the enemy's victories.
Because God has turned the captivity and the people have returned to their land, the fasts may still be kept as commemorations but with transformed meaning, becoming to the house of Judah joy and gladness and cheerful feasts and celebrations.
Their rejoicing was to express faith and remember God's mercies and blessings while feasting on his blessings.
The change came because the people had profited by the reproof about fasting in Zechariah 7:1-7.

The promise is conditional on an abiding love of truth and peace.
If wickedness is loved instead, the judgments of God will again be received.
Applied to captivity in sin, the verse points to God turning fasting and mourning into joy and rejoicing by bringing salvation and leading his people to their goodly inheritance.
There the land is beautiful, the water is the river of life, and its inhabitants are immortal.