Closed devnrc closed 6 years ago
Thanks, @devnrc . This is great. I'd counter-propose the following, if we want to keep to the last day of each month:
const year = f.field2.substring(0,4);
const month = f.field2.substring(4);
const sfDate = new Date(year, month, 0).toISOString();
Note that we also drop the unnecessary dateString
step. If you like it, would you update the PR and re-submit? (Or let me know and I'll add it myself.)
Changed from 31 of a month to 1 for all those shorter months. :)