This is a known limitation of the Monaco editor component from Microsoft. new Date() strictly speaking returns a JavaScript date object, not a number. Even though a date object IS a number! Sometimes JavaScript is just weird.
jbudd has shown one way to fix it. Another way would be: