Simpler to do 

let dateStr = aDateStr.replace(/-/g, " ")

The if check doesn't really save time here.