I'm wondering if there's any built-in functionality in .NET for declining dates in languages that support noun declensions,
(ie. In Russian the month name is февраль
, but if I wanted to say the date or say that something is due by, I'd use the form февраля
). I made my own version, which works for this case, but I will need to expand to to other cases, and other languages, which will have their own declensions for dates.
Is this functionality built-in, or available in an external library? Thank you for any help.
I've provided my function for the Russian genitive case, if my explanation wasn't clear.
public static string DeclineMonth(this DateTime time)
{
var month = time.ToString("MMMM");
if (month.Last() == 'ь')
return month.Replace('ь', 'я');
else
return month + "a";
}