Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bk/rename day and month #287

Merged
merged 3 commits into from
Dec 19, 2023
Merged

Bk/rename day and month #287

merged 3 commits into from
Dec 19, 2023

Conversation

bryankeller
Copy link
Contributor

@bryankeller bryankeller commented Dec 19, 2023

Details

Many people are confused by the purpose of Day. Is it like my custom Day type used in my company's codebase? Is it like Date? Is it like DateComponents? Why can't I initialize it myself?

Day (and Month) are really just small structs that contain some components of a day / month. They're much more similar to DateComponents, but because they're only created internally and vended out through the public API of the calendar, we can guarantee a few things:

  • They're Orderable in relation to any other date that's vended out of the same CalendarView instance
  • They're valid for whatever Calendar and date range the CalendarView was initialized with

People should treat them like read-only bags of data. They just exist as a way for CalendarView to pass some data back to API consumers. Hopefully these new names and documentation tweaks help clarify that a bit, and people stop asking why their initializers aren't public.

Related Issue

N/A

Motivation and Context

Improve API and make it more self-documenting.

How Has This Been Tested

Example app

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

@bryankeller bryankeller added documentation Improvements or additions to documentation enhancement New feature or request labels Dec 19, 2023
@bryankeller
Copy link
Contributor Author

FYI after this is merged, I'll bump everything to v2.0.0🥳

@bryankeller bryankeller merged commit 4332559 into master Dec 19, 2023
3 checks passed
@bryankeller bryankeller deleted the bk/rename-day-and-month branch December 19, 2023 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants