Why is capital of Denmark (Copenhagen) called "Kodaň" in Czech and Slovak?

So the original name of Denmark's capital is "København" and that's how it's called in Denmark and Norway. Other Languages modified that name, depending on their linguistic needs, most of them are based on German version of that name - "Kopenhagen". However, Czechia and Slovakia did kinda odd move and they call it "Kodaň". How did they came up with it?