nit: I think ternary is more readable, but up to you:
```
timestamp = detail.timestamp ? new Date(detail.timestamp) : new Date();