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

Fixing possible range for week_of_month type #704

Merged
merged 1 commit into from
Mar 8, 2022

Conversation

tayjohno
Copy link
Contributor

@tayjohno tayjohno commented Jan 25, 2022

Summary of changes

Pretty straightforward change to make the type specification match the actual possible outputs from the existing function. See #703 for full details, but in summary the week_of_month function can return values up to 6, but the type currently specifies that it should return a value between 1 and 5.

iex> Timex.week_of_month(2022,1,31)
6

January 2022 Calendar:

week  Su Mo Tu We Th Fr Sa

1                       01
2     02 03 04 05 06 07 08
3     09 10 11 12 13 14 15
4     16 17 18 19 20 21 22
5     23 24 25 26 27 28 29
6     30 31

I searched through the application, and this function (Timex.week_of_month) was the only place where this type is being used.

Checklist

  • [NA] New functions have typespecs, changed functions were updated
  • [NA] Same for documentation, including moduledocs
  • [NA] Tests were added or updated to cover changes
  • Commits were squashed into a single coherent commit
  • Notes added to CHANGELOG file which describe changes at a high-level

@bitwalker bitwalker merged commit eb666f6 into bitwalker:main Mar 8, 2022
@tayjohno tayjohno deleted the fix-week-range branch March 16, 2022 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants