set up unit-tested js date helper