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

Quickfix d'un test sensible à la date courante #3869

Merged
merged 1 commit into from
Apr 8, 2024
Merged

Quickfix d'un test sensible à la date courante #3869

merged 1 commit into from
Apr 8, 2024

Conversation

ptitfred
Copy link
Contributor

@ptitfred ptitfred commented Apr 8, 2024

Voir #3868

@ptitfred ptitfred requested a review from thbar April 8, 2024 11:04
@ptitfred ptitfred requested a review from a team as a code owner April 8, 2024 11:04
Copy link
Contributor

@thbar thbar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merci !

La méthode window étant déjà elle testée ici via des doctests:

@doc """
iex> window(~D[2024-04-01])
-3
iex> window(~D[2024-04-02])
-1
iex> window(~D[2024-04-03])
-1
"""
def window(%Date{} = inserted_at) do
if inserted_at |> Date.day_of_week() == 1 do
-3
else
-1
end
end

On est bon pour moi.

Merci pour ton fix rapide @ptitfred !

@thbar thbar enabled auto-merge April 8, 2024 11:06
@thbar thbar added this pull request to the merge queue Apr 8, 2024
Merged via the queue into master with commit 835e198 Apr 8, 2024
4 checks passed
@thbar thbar deleted the fix-3868 branch April 8, 2024 11:14
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