Skip to content

Conversation

@stevebroshar
Copy link

I'm interested in using formula.js, and it's important the functions act like excel does. This PR modifies DATE() to handle the parameters like excel does. It adds 1900 to year it it's 0..1899, errors if year is >9999, and allows negative month and day values -- which js handles correctly by selecting a date at a negative month/day offset.

I guess one might argue that adding 1900 to a year like 1899 (to get 3799!) is of questionable value, but it is what excel does.

I also added test cases. And I added more structure to the tests -- closer to the ideal of one assert per test.

This will probably be the first PR from me. I will submit more if this one seems good and when I find issues with other functions.

@stevebroshar
Copy link
Author

Since I didn't hear back on this change for a while, I forked the davidpolberger branch and implemented my changes on that code line. So, there's not much value in only merging in this one little change.

I am concerned that development of the project has become fractured into many different branches. But, I don't know how to improve that situation.

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.

1 participant