evanisnor / durationjs

A JavaScript library for parsing and manipulating ISO 8601 formatted duration strings.
MIT License
13 stars 6 forks source link

Simple examples #9

Open desimone opened 11 years ago

desimone commented 11 years ago

Ideas

evanisnor commented 11 years ago

The problem with providing context to examples is that duration.js right now has no concept of a starting point. It just parses and/or creates a compliant duration string. When (if) we add support for date and time then it would make sense.

I'm having trouble thinking about how to design a useful date library around durations, though. So, let's say you have a date and time for an event in the future. Do you want to know the duration between now and the event? If the event is in the past, do you want to know the duration from the beginning to now? I think maybe I just answered myself.