pilwon / node-yahoo-finance

Yahoo Finance historical quotes and snapshot data downloader written in Node.js
491 stars 123 forks source link

Fixed date conversion problem by using moment. #12

Closed brianedgerton closed 9 years ago

brianedgerton commented 9 years ago

I'm using this for a pet project and I noticed that the lib was not creating dates correctly from the string in the historical data CSV. The Date object being created was actually a day earlier than the specified string. Not sure exactly why this was happening, but, since moment was already available, I fixed it by creating the moment object with an explicit format and then grabbing the raw JS date object. Seems to work.

Thanks for the library!

pilwon commented 9 years ago

@brianedgerton Thanks this is great. Would you be able to change the double quotations used for string to single quotations for code consistency?

brianedgerton commented 9 years ago

@pilwon Sorry about that. We use double quotes at work :)

neverfox commented 9 years ago

Submitted a pull request to correct the fact that, while this fixed historical dates, it broke snapshot dates.