My father asked me to look over some pages of text he's written. His, uhm, command of German grammar* isn't the best, and so off to proofreading I went. German grammar rules are complex enough, but then there are exceptions, and even the exceptions sometimes have exceptions.
There is one in particular that drives me nuts. We have prepositions that force the use of certain cases even if said case would not be indicated otherwise. That's mostly fine, one eventually gets the hang of it (as native speaker, at least), but it wouldn't be German without exceptions. There's a small set of prepositions that can indicate the use of either dative or accusative case. An (meaning at, to, or by) is one of them.
Which case is indicated by the preposition then depends on what you want to express. A location following "an" is always in the dative case, e.g. Die Katze sitzt am Fenster (The cat is sitting at the window, am is a contraction of an and dem, the article of Fenster), unless the verb of the sentence is used to express direction towards/away from the location, i.e. Die Katze lehnt sich ans Fenster** (The cat is leaning against the window, ans being a contraction of an and das, accusiative case).
Confused yet? You probably should be. The dative case is always used when an is used with expressing time, e.g. Am Montag (Montag = Monday). There's actually no exception to that, which is a nice change of pace. There is, however, an exception for appositions whenever an is used to express time. Why? I have no idea. Really, none. Whenever you have an apposition that apposition inherits the case of the element it is in apposition to.
Which in the end means that when expressing a point in time with an, the following apposition can have either the dative or the accusative case. Both are considered correct. E.g. Am Montag, dem 23. Jänner, gehen wir aus. and Am Montag, den 23. Jänner, gehen wir aus. both meaning On Monday, January 23rd, we'll go out, and both are correct German.
Using the accusative case feels wrong. It looks wrong. It just... isn't. It should be wrong, dammit! I was halfway through correcting every instance of den until I remembered that it's not really wrong. Bah.
* In his defense, German grammar was created by Satan himself as a means of torture, it's not uncommon to struggle. It's objetively hard even for us natives to write grammatically correct German.
** To make matters even worse, if you'd remove the third person reflexive pronoun sich (here meaning itself) from the sentence, you need to use the dative case again, e.g. Die Katze lehnt am Fenster (The cat leans against the window - no more present progressive) because lehnen alone no longer indicates any direction in the act of leaning, it's just something the cat does at the location. So that makes sense, does it?