Humanizer icon indicating copy to clipboard operation
Humanizer copied to clipboard

Add time of day-based greetings

Open XVII opened this issue 2 years ago • 2 comments

It would be useful to have a helper function for building Greetings, i.e. "Good morning", "Good afternoon", "Good evening" based on the current time.

Perhaps an extension to DateTime and TimeOnly along the lines of .ToPeriodOfDayNotation() might be the best way to implement this. It would return "morning" or "afternoon" or "evening" which could then be adapted into a greeting.

Or, could be .ToGreetingNotation() perhaps?

XVII avatar Aug 03 '23 06:08 XVII

This seems like a fun idea but also like a potentially very deep can of worms 😛 Different cultures might have different times of day, fundamentally different greetings, and all text needs to be localized. The localization of periods of the day and greetings has overlap with but isn't strictly the same thing as the language in which it's expressed.

logiclrd avatar Oct 02 '25 08:10 logiclrd

Fair enough. It seems like it was partially implemented for a time of day perspective in Spanish but can understand why it's a can of worms.

Maybe instead of a greeting, could Humanizer provide a binary AM/PM meridian via TimeOnly? I.e. TimeOnly.IsAM or TimeOnly.IsPM helper. This could help power the above scenario but without the complexity.

12-hour Clock AM/PM

XVII avatar Oct 05 '25 22:10 XVII