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";
}
question from:
https://stackoverflow.com/questions/42132299/are-there-built-in-month-name-declensions-in-c-sharp 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…