Skip to content

Commit

Permalink
Update readme with date to words
Browse files Browse the repository at this point in the history
Changed the readme to add date-to-words documentation.
  • Loading branch information
CiscoAstrum committed Jun 9, 2022
1 parent 6e0aa69 commit b0c09df
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions readme.md
Expand Up @@ -889,13 +889,15 @@ Passing `wordForm` argument in when it is not applicable will not make any diffe
This is kind of an extension of ToWords and Ordinalize
```C#
// for Spanish locale
new DateTime(2022, 1, 1).ToOrdinalWords() => "uno de enero de dos mil veintidós"
new DateOnly(2020, 6, 10).ToOrdinalWords() => "diez de junio de dos mil veinte"
new DateOnly(1999, 12, 31).ToOrdinalWords() => "treinta y uno de diciembre de mil novecientos noventa y nueve"
new DateTime(2022, 1, 1).ToWords() => "uno de enero de dos mil veintidós"
new DateOnly(2020, 6, 10).ToWords() => "diez de junio de dos mil veinte"
new DateOnly(1999, 12, 31).ToWords() => "treinta y uno de diciembre de mil novecientos noventa y nueve"
// for English UK locale
new DateTime(2022, 1, 1).ToOrdinalWords() => "the first of January two thousand and twenty-two"
new DateTime(2022, 1, 1).ToWords() => "the first of January two thousand and twenty-two"
new DateOnly(1999, 12, 31).ToWords() => "the twenty-first of December one thousand nine hundred and ninety-nine"
// for English US locale
new DateTime(2022, 1, 1).ToOrdinalWords() => "January first, two thousand and twenty-two"
new DateTime(2022, 1, 1).ToWords() => "January first, two thousand and twenty-two"
new DateOnly(1999, 12, 31).ToWords() => "December twenty-first, one thousand nine hundred and ninety-nine"
```

The ToWords method of `DateTime` or `DateOnly` also supports grammatical case.
Expand Down

0 comments on commit b0c09df

Please sign in to comment.