I always seem to find myself landing here only to realize that the title and question are not quite aligned.
(我似乎总是发现自己落在这里只是为了意识到标题和问题并不完全一致。)
If you want a date object from a string :
(如果你想要一个字符串的日期对象 :)
const myDate = moment(str, 'YYYY-MM-DD').toDate();
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…