Handle DATE() parameters the same as excel does.#52
Open
stevebroshar wants to merge 1 commit intosutoiku:masterfrom
TruDB:master
Open
Handle DATE() parameters the same as excel does.#52stevebroshar wants to merge 1 commit intosutoiku:masterfrom TruDB:master
stevebroshar wants to merge 1 commit intosutoiku:masterfrom
TruDB:master
Conversation
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.