Skip to content
This repository has been archived by the owner on Mar 21, 2022. It is now read-only.

Add Property to Ignore Fixed Periods #4

Open
mattt opened this issue Jul 25, 2019 · 0 comments
Open

Add Property to Ignore Fixed Periods #4

mattt opened this issue Jul 25, 2019 · 0 comments
Labels
good first issue Good for newcomers

Comments

@mattt
Copy link
Collaborator

mattt commented Jul 25, 2019

I could imagine consumers of this library wanting to ignore fixed periods when getting the string for a day period in certain locales. Although I wouldn't necessarily advise this usage, someone might prefix the English language day period with the word "Good" as a greeting to users ("Good morning", "Good afternoon", etc.). Without filtering on fixed periods, this would lead to awkward constructions like "Good noon" and "Good midnight".

Implementation-wise, this would involve the following:

  • Adding a new property to DayPeriodFormatter (naming is probably the hardest part of this feature)
  • Updating DayPeriodRuleSet.period(for:) to take a second parameter to pass the aforementioned property value to conditionally ignore any fixed period for a given hour.
@mattt mattt added the good first issue Good for newcomers label Jul 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Good for newcomers
Development

No branches or pull requests

1 participant