Skip to content

Update Time.add message about units #13121

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

Merged
merged 1 commit into from
Nov 18, 2023

Conversation

solar05
Copy link
Contributor

@solar05 solar05 commented Nov 18, 2023

Since spec tells that Time.add support :hour and :minute:

@spec add(Calendar.time(), integer(), :hour | :minute | System.time_unit()) :: t()

But actual message is:

Time.add(Time.utc_now(), 2, :minutes)
** (ArgumentError) unsupported time unit. Expected :second, :millisecond, :microsecond, :nanosecond, or a positive integer, got :minutes

After fix:

Time.add(Time.utc_now(), 2, :minutes)
** (ArgumentError) unsupported time unit. Expected :hour, :minute, :second, :millisecond, :microsecond, :nanosecond, or a positive integer, got :minutes

@josevalim josevalim merged commit da671de into elixir-lang:main Nov 18, 2023
@josevalim
Copy link
Member

💚 💙 💜 💛 ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants