Fix `new Date` calls when editing documents.

Fixes #135