nl_tokens: Get the time difference between two datestrings .
pl_tokens: function getDateDifference ( timestr1 , timestr2 ) { // Force into predictable date format var start = timestr1 . toLocaleDateString ? timestr1 : new Date ( timestr1 ) ; var <mask> = timestr2 . toLocaleDateString ? timestr2 : new Date ( timestr2 ) ; if ( start . toString ( ) === 'Invalid Date' || end . toString ( ) === 'Invalid Date' ) { throw new TypeError ( 'pendel.date() expects two valid date strings' ) ; } var dr = moment . range ( start , end ) ; return { years : dr . diff ( 'years' ) , months : dr . diff ( 'months' ) , weeks : dr . diff ( 'weeks' ) , days : dr . diff ( 'days' ) , hours : dr . diff ( 'hours' ) , minutes : dr . diff ( 'minutes' ) , seconds : dr . diff ( 'seconds' ) } ; }