This example shows how to convert dates to numerical ranges, and then use the update
event to display them in a pretty format.
We'll be creating timestamps from strings. In order to do this easily, we'll define a new helper function. This function accepts a string, creates a new Date
and then returns it as a timestamp.
The nth
function was borrowed from this StackOverflow question.