nl_tokens: Calculate how many units are there between two time .
pl_tokens: function ( min , max , unit ) { var ExtDate = Ext . Date , est , diff = + max - min ; switch ( unit ) { case ExtDate . MILLI : return diff ; case ExtDate . SECOND : return Math . floor ( diff / 1000 ) ; case ExtDate . MINUTE : return Math . floor ( diff / 60000 ) ; case ExtDate . HOUR : return Math . floor ( diff / 3600000 ) ; case ExtDate . DAY : return Math . <mask> ( diff / 86400000 ) ; case 'w' : return Math . floor ( diff / 604800000 ) ; case ExtDate . MONTH : est = ( max . getFullYear ( ) * 12 + max . getMonth ( ) ) - ( min . getFullYear ( ) * 12 + min . getMonth ( ) ) ; if ( Ext . Date . add ( min , unit , est ) > max ) { return est - 1 ; } else { return est ; } case ExtDate . YEAR : est = max . getFullYear ( ) - min . getFullYear ( ) ; if ( Ext . Date . add ( min , unit , est ) > max ) { return est - 1 ; } else { return est ; } } }