Coder Social home page Coder Social logo

Comments (5)

nicmendoza avatar nicmendoza commented on August 12, 2024 2

If I understand the thread correctly, yes it does seem you can already have a fiscal year that ends on Feb 29th.

>>> import fiscalyear
>>> fiscalyear.setup_fiscal_calendar(start_month=3)
>>> year = fiscalyear.FiscalYear(2016)
>>> year.end
FiscalDateTime(2016, 2, 29, 23, 59, 59)

Additional thought: We could consider adding an explicit error case for anyone attempting to call it with those parameters (i.e. _check_day(2, 29)), just for the sake of clarity/completeness. Setting Feb 29th as the start date for a fiscal year seems meaningless (unless we find evidence that there are businesses which use Feb 29th as the start date in leap years and Feb 28th/March 1st in other years?). It might make sense to clarify in the comments that the _check_day function checks whether the day/month arguments are a valid start date for a fiscal year rather than "a valid day of month." And/or perhaps give it a more meaningful name.

from fiscalyear.

adamjstewart avatar adamjstewart commented on August 12, 2024

Interesting, I didn't realize that someone might want to use a leap day/month in this way.

I wonder if we should just change 2001 to be a leap year. That would keep the code simple but also allow for this behavior. Thoughts?

from fiscalyear.

adamjstewart avatar adamjstewart commented on August 12, 2024

Also, the logic you pointed out is only used to define the start of a fiscal calendar, not the end. Isn't is already possible to have a fiscal calendar that ends on Fed 29th?

from fiscalyear.

qwertytam avatar qwertytam commented on August 12, 2024

Where I initially came across this is the data I'm working with gives fiscal year end not start. From looking through the 10-k/q's etc filed with the SEC, all of them (that I've looked through) give the date for the period ending. Perhaps this issue is better approached by being able to initialize a fiscal calendar with a period ending year/month/day? Just a thought given how the SEC financial reports are organized/reported.

from fiscalyear.

adamjstewart avatar adamjstewart commented on August 12, 2024

Yes, we could definitely modify setup_fiscal_calendar to accept either start_* or end_* (but not both). If you want to submit a PR to make this change I'm happy to review. I'm currently swamped with a paper deadline at the end of the month, so I may not be able to get to this anytime soon.

from fiscalyear.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.