JavaScript TimeSpan

<script src="https://momentjs.com/downloads/moment.js"></script>
<script>
    // Use moment.js
    moment().subtract('days', 6).calendar();
    // last Sunday at 8:23 PM
    moment().startOf('hour').fromNow();
</script>
Undefined