“Also on the tenth day of this seventh month there shall be a day of atonement: it shall be a holy convocation unto you; and ye shall afflict your souls… And ye shall do no work in that same day… For whatsoever soul it be that shall not be afflicted in that same day, he shall be cut off from among his people... It shall be unto you a sabbath of rest, and ye shall afflict your souls: in the ninth day of the month at even, from even unto even, shall ye celebrate your sabbath.”
“And I set my face unto the Lord God, to seek by prayer and supplications, with fasting, and sackcloth, and ashes… In those days, I, Daniel, was mourning three full weeks. I ate no pleasant bread, neither came flesh nor wine in my mouth, neither did I anoint myself at all, till three whole weeks were fulfilled.”
Dan. 9:3; 10:2-4
Neh. 8:9-12 says:
“Nehemiah… taught the people… ‘This day is holy unto the Lord your God; mourn not, nor weep.’ For all the people wept, when they heard the words of the law. Then he said unto them, Go your way, eat the fat, and drink the sweet, and send portions unto them for whom nothing is prepared: for this day is holy unto our Lord: neither be ye sorry; for the joy of the Lord is your strength. So the Levites stilled all the people, saying, ‘Hold your peace, for the day is holy; neither be ye grieved.’ And all the people went their way to eat, and to drink, and to send portions, and to make great mirth, because they had understood the words that were declared unto them.’
Some derive from this passage and others (such as Isa. 58:2-3) that the New Testament First-Day Sabbath is to be one of rejoicing only. While, no doubt, the Lord’s Day ought to be primarily a day of rejoicing, being our commemoration of Christ’s resurrection from the dead and triumph over the grave, yet it does not preclude the whole of every proper relation that we have to God, which sometimes includes mourning and fasting when we meet with Him, due to our sins and our seeking to turn away his righteous anger and and providential judgment (Dan. 9 & 10, quoted above).
This is born out of many places in scripture, but specifically from the appropriateness of the Day of Atonement in the Old Testament, which was called a sabbath, both in Lev. 23:38 and in Col. 2:16. The regular weekly New Testament Sabbath encompasses all the characteristics of the various and diverse Old Testament sabbaths. God in Isa. 58:3-7 addresses the abuse of carnal fasting and in Neh. 8 rectifies providentially inappropriate fasting, but this should not dissuade us from the occasional affliction of our body through fasting coupled with real spiritual contrition when it is sorely needed on the Lord’s Day.
This was the perspective of the puritans who helpfully elucidated this question (and practiced the answer of it). One quote is below, more will be coming.
Samuel Rutherford 1642
We think to deny the lawfulness of public fasting on the Lord’s day, as if the Christian Sabbath were a day only of spiritual feasting and rejoicing, because that day Christ ended the work of redemption and second creation, is a wronging of the Christian Sabbath, which is ordained for the whole public worship of God, joying, sorrowing for sin, learning God’s will in all and every point, as the Jewish Sabbath was not ordained only for meditation on the work of creation, but for worships of all kinds: The worship of this day, Acts 20:7, is as large as preaching, and being in the Spirit, on the Lord’s day, and seeing the visions of God, Rev. 1:10-12, and the whole ordinary public worship. It is then too narrow to restrict all our Sabbath-worship to one single act of festival rejoicing.
‘Question 81: May We Lawfully Keep the Lord’s Day as a Fast?’ in Christian Directory, Part IV, Christian Politics, p. 432