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

Make dynamic days more readable #344

Merged
merged 1 commit into from
Nov 21, 2023
Merged

Make dynamic days more readable #344

merged 1 commit into from
Nov 21, 2023

Conversation

pil0u
Copy link
Owner

@pil0u pil0u commented Nov 21, 2023

Summary of changes and context

Title.

Sanity checks

  • Linters pass
  • Tests pass
  • Related GitHub issues are linked in the description

@pil0u pil0u merged commit 70c69fe into main Nov 21, 2023
5 checks passed
@pil0u pil0u deleted the pilou/readable-intervals branch November 21, 2023 20:02
Copy link
Collaborator

@Aquaj Aquaj left a comment

Choose a reason for hiding this comment

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

En vrai je suis pas fan. Ça ne marche que parce que le begin_time tombe sur le 1er du mois.
Je sais que l'AoC ne tombera jamais un 2 décembre ou quoi, mais du coup pour moi le code n'exprime pas bien la réalité là, il aurait aussi fallu changer le nommage de begin_time ou quelque chose du genre.

@pil0u
Copy link
Owner Author

pil0u commented Nov 24, 2023

@Aquaj Je ne suis pas 100% fan non plus, c'est quoi le "mieux" selon toi ? Une méthode genre

# aoc.rb

def self.release_time(day)
  Time.new(2023, 12, day, 0, 0, 0, "-05:00")
end

qu'on call ensuite

Aoc.release_time(day)
# ou
Aoc.release_time(day) + 48.hours

Ça a plus de gueule en effet 😁

@Aquaj
Copy link
Collaborator

Aquaj commented Nov 28, 2023

J'avais pas forcément d'alternative à part rollback la PR, ce que tu proposes est plus propre déjà (car ça permet de centraliser toute la logique de manipulation des jours au même endroit: aoc.rb).
Bonne idée 👍

@pil0u
Copy link
Owner Author

pil0u commented Nov 29, 2023

#372

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.

3 participants