Why feminine?

I have this excerpt from Credo:

et resurrexit tertia die

“Tertia” is the ablative feminine case of “tertius”, third.
But if it’s supposed to agree with “dies”, shouldn’t it be the masculine declension, which is “tertiō”?

diēs can be either masculine or feminine.

It’s interesting that the Vulgate goes back and forth. 1Cor 15:4 and Hos 6:3 both have it as feminine, but elsewhere, like Matthew 17:22, it’s masculine.