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

Add support for WEEK/DAY period #979

Closed
wants to merge 15 commits into from
Closed

Add support for WEEK/DAY period #979

wants to merge 15 commits into from

Conversation

bonjourmauko
Copy link
Member

@bonjourmauko bonjourmauko commented Mar 11, 2021

New features

This is a test-driven attempt to capitalise on #966 from @nikhilwoodruff, to add support for weeks in OpenFisca.

The main difference is that this draft makes a distinction between days and weekdays.

In doing so, we can treat both ISO dates and ISO week dates interchangeably.

Scope is yet more limited than your examples @nikhilwoodruff.

Right now, OpenFisca period model relies on the assumption that period fit well together. A YEAR is composed a 12 MONTHs .

My idea would be to rely on Instant for values, and let Period handle both date types, 2014-01-03 and 2014-W3-1.

We could either let the parser do that with the actual type string, or separate the two periods in different classes and let Period orchestrate/dispatch between the two as needed.

  • If A's definition period is the week, can I calculate A for a year?

Yes, as long as we identify common years of 52W or leap years of 53W, or that we use the average of ~52.2 weeks per year.

  • If so, what do I do with the weeks that are only partially included in the year?

TBD

  • Can we have a generic answer to the previous question, or is it going to be country-specific?

TBD

Comments? @sandcha @guillett @Morendil @Br3nda @sarafalamaki @benjello et al.

@bonjourmauko bonjourmauko added kind:feat A feature request, a feature deprecation policy:rfc Request For Comments: chime in! labels Mar 11, 2021
@bonjourmauko bonjourmauko changed the title [RFC] Add support for WEEK/DAY period Add support for WEEK/DAY period Oct 4, 2021
@Br3nda Br3nda self-requested a review July 25, 2022 22:09
@bonjourmauko bonjourmauko mentioned this pull request Aug 1, 2022
@bonjourmauko
Copy link
Member Author

Superseded by #1146

@bonjourmauko bonjourmauko deleted the add-week branch November 17, 2022 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:feat A feature request, a feature deprecation policy:rfc Request For Comments: chime in!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant