Option to Parse any DateFormat using momentjs
Not sure how to create a pull request for this; but this works for me to parse a "MM/DD/YYYY" date.
const moment = require('moment');
function parseValue(recordValue, mappingObject) {
if(mappingObject.format === 'jsDate') {
// convert millisconds to nanoseconds
return (new Date(recordValue).getTime()) * 1000 * 1000;
}
if(mappingObject.format != '') {
return (moment(recordValue,mappingObject.format)) * 1000 * 1000;
}
return recordValue;
}
Hi @nzidol! Do you need help with opening pull request?
No I would need to learn how to develop node modules....
On Wed, Mar 27, 2019 at 5:29 AM Evgeny Smyshlyaev [email protected] wrote:
Hi @nzidol https://github.com/nzidol! Do you need help with opening pull request?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/CorpGlory/csv2influx/issues/52#issuecomment-476732234, or mute the thread https://github.com/notifications/unsubscribe-auth/AM_PHVNrY8xbpRfovB3d4WVs4NEHhx4vks5vakragaJpZM4cKXW9 .
@nzidol is it fun for learn it? Cuz if you just want to see it working, we can make a PR for you