You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is kind of an extension of ToWords and Ordinalize
890
+
```C#
891
+
// for Spanish locale
892
+
newDateTime(2022, 1, 1).ToOrdinalWords() =>"uno de enero de dos mil veintidós"
893
+
newDateOnly(2020, 6, 10).ToOrdinalWords() =>"diez de junio de dos mil veinte"
894
+
newDateOnly(1999, 12, 31).ToOrdinalWords() =>"treinta y uno de diciembre de mil novecientos noventa y nueve"
895
+
// for English UK locale
896
+
newDateTime(2022, 1, 1).ToOrdinalWords() =>"the first of January two thousand and twenty-two"
897
+
// for English US locale
898
+
newDateTime(2022, 1, 1).ToOrdinalWords() =>"January first, two thousand and twenty-two"
899
+
```
900
+
901
+
The ToWords method of `DateTime` or `DateOnly` also supports grammatical case.
902
+
You can pass a second argument to `ToWords` to specify the case of the output.
903
+
The possible values are `GrammaticalCase.Nominative`, `GrammaticalCase.Genitive`, `GrammaticalCase.Dative`, `GrammaticalCase.Accusative`, `GrammaticalCase.Instrumental` and `GrammaticalGender.Prepositional`
904
+
887
905
### <aid="date-time-to-ordinal-words">DateTime to ordinal words</a>
0 commit comments