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.
Hello! I am very excited to help contribute to this library as I have been a significant power user for the past year. I can only imagine how much hard work has gone into this.
The problem I had is that when I would create an Excel file with a date type field and write it out as CSV, Moment.js would parse it based on the user's local time. This meant that sometimes when formatting the date into a less verbose format, say (MM/DD/YYYY) it would be off by one day due to the timezone.
This pull request adds an option to the CSV writing module that allows for the user to override this functionality using the
moment.utc()
function. The advantage here is that less specific date formats (i.e. the cell is originally just MM/DD/YYYY) don't get parsed as the wrong date just because Excel defaults the time to 00:00;Adding the option may not be the best way to implement this feature but it fixed the issue I was having and hopefully can help alleviate some issues related to dates having unknown behavior.