Comments (5)
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.
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.
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.
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.
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)
- Support for a 4-4-5 calendar HOT 1
- Support for week number of a date in a FiscalYear HOT 20
- Incorrect fiscal_day returned for last day of the year HOT 1
- Fiscal Month Offset HOT 7
- Syntactic sugar for getting the current Fiscal{Year,Quarter} HOT 2
- FY=2022 for US 2021 calendar year HOT 1
- Add a function for easily changing the global "START_*" parameters HOT 2
- Make it possible to use multiple calendar settings in the same app. HOT 5
- FiscalCalendar starting on 31st day of the month throws ValueError HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fiscalyear.