Skip to content

Commit

Permalink
Fix documentation and README
Browse files Browse the repository at this point in the history
  • Loading branch information
strobelt committed Oct 28, 2021
1 parent 20f7343 commit bbd5283
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
15 changes: 15 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Humanizer meets all your .NET needs for manipulating and displaying strings, enu
- [Number to words](#number-to-words)
- [Number to ordinal words](#number-to-ordinal-words)
- [DateTime to ordinal words](#date-time-to-ordinal-words)
- [TimeOnly to Clock Notation](#time-only-to-clock-notation)
- [Roman numerals](#roman-numerals)
- [Metric numerals](#metric-numerals)
- [ByteSize](#bytesize)
Expand Down Expand Up @@ -864,6 +865,20 @@ The possible values are `GrammaticalCase.Nominative`, `GrammaticalCase.Genitive`

Obviously this only applies to some cultures. For others passing case in doesn't make any difference in the result.

### <a id="time-only-to-clock-notation">TimeOnly to Clock Notation</a>
Extends TimeOnly to allow humanizing it to a clock notation
```C#
// for English US locale
new TimeOnly(3, 0).ToClockNotation() => "three o'clock"
new TimeOnly(12, 0).ToClockNotation() => "noon"
new TimeOnly(14, 30).ToClockNotation() => "half past two"

// for Brazilian Portuguese locale
new TimeOnly(3, 0).ToClockNotation() => "três em ponto"
new TimeOnly(12, 0).ToClockNotation() => "meio-dia"
new TimeOnly(14, 30).ToClockNotation() => "duas e meia"
```

### <a id="roman-numerals">Roman numerals</a>
Humanizer can change numbers to Roman numerals using the `ToRoman` extension. The numbers 1 to 10 can be expressed in Roman numerals as follows:

Expand Down
2 changes: 1 addition & 1 deletion src/Humanizer/Configuration/Configurator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public static LocaliserRegistry<IDateOnlyToOrdinalWordConverter> DateOnlyToOrdin

private static readonly LocaliserRegistry<ITimeOnlyToClockNotationConverter> _timeOnlyToClockNotationConverters = new TimeOnlyToClockNotationConvertersRegistry();
/// <summary>
/// A registry of ordinalizers used to localise Ordinalize method
/// A registry of time to clock notation converters used to localise ToClockNotation methods
/// </summary>
public static LocaliserRegistry<ITimeOnlyToClockNotationConverter> TimeOnlyToClockNotationConverters
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
namespace Humanizer.Localisation.TimeToClockNotation
{
/// <summary>
/// The interface used to localise the ToClockWords method.
/// The interface used to localise the ToClockNotation method.
/// </summary>
public interface ITimeOnlyToClockNotationConverter
{
/// <summary>
/// Converts the time to Clock Words
/// Converts the time to Clock Notation
/// </summary>
/// <param name="time"></param>
/// <returns></returns>
Expand Down
2 changes: 1 addition & 1 deletion src/Humanizer/TimeOnlyToClockNotationExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace Humanizer
{
/// <summary>
/// Humanizes DateTime into human readable sentence
/// Humanizes TimeOnly into human readable sentence
/// </summary>
public static class TimeOnlyToClockNotationExtensions
{
Expand Down

0 comments on commit bbd5283

Please sign in to comment.