I recently ran into a problem - in some parts of my angular application I have to show the date in the following format: MMMM yyyy , as well as in some Angular components UI Bootstrap .
The main problem is that in some languages the month in the nominative and genitive cases differs in different ways. In my case, it will be Polish, Ukrainian and Russian.
As it seems by default, MMMM means the name of the month in the genitive, which usually makes sense.
Although I noticed that in the angular files the locales for Russian and Polish have the STANDALONEMONTH property, which, as I see it, denotes the name of the month in the nominative case. (although the file for Ukrainian is missing in this part)
Although I'm not quite sure how to use them. My main suggestion would be to go with a decorator for dateFilter .
So the question is whether there is a standard way to handle the flex of the month name in angular or a workaround that is commonly used, so third-party libraries using $locale will use the corresponding month name.
Example
date: '2016-01-20' en-us: 'dd MMMM yyyy' -> '20 January 2016' 'MMMM yyyy' -> 'January 2016' uk-ua: 'dd MMMM yyyy' -> '20 і 2016' // genitive case - it is fine 'MMMM yyyy' -> 'і 2016' // wrong: should be 'і 2016' pl-pl: 'dd MMMM yyyy' -> '20 stycznia 2016' // genitive case - it is fine 'MMMM yyyy' -> 'stycznia 2016' // wrong: should be 'styczeń 2016'
As you can see - for the Ukrainian and Polish names of the month there should be a different ending in these two cases. In addition, for the Polish and Russian languages, there is the name of the month, as appropriate, in the angular locale files ( STANDALONEMONTH ). Although I’m not quite sure that they are used everywhere - I couldn’t find a use, or maybe I’m missing something.