Fixing date display in js