nl_tokens: Align the date to unit .
pl_tokens: function ( date , unit , step ) { var num = new Date ( + date ) ; switch ( unit . toLowerCase ( ) ) { case Ext . <mask> . MILLI : return num ; break ; case Ext . Date . SECOND : num . setUTCSeconds ( num . getUTCSeconds ( ) - num . getUTCSeconds ( ) % step ) ; num . setUTCMilliseconds ( 0 ) ; return num ; break ; case Ext . Date . MINUTE : num . setUTCMinutes ( num . getUTCMinutes ( ) - num . getUTCMinutes ( ) % step ) ; num . setUTCSeconds ( 0 ) ; num . setUTCMilliseconds ( 0 ) ; return num ; break ; case Ext . Date . HOUR : num . setUTCHours ( num . getUTCHours ( ) - num . getUTCHours ( ) % step ) ; num . setUTCMinutes ( 0 ) ; num . setUTCSeconds ( 0 ) ; num . setUTCMilliseconds ( 0 ) ; return num ; break ; case Ext . Date . DAY : if ( step == 7 || step == 14 ) { num . setUTCDate ( num . getUTCDate ( ) - num . getUTCDay ( ) + 1 ) ; } num . setUTCHours ( 0 ) ; num . setUTCMinutes ( 0 ) ; num . setUTCSeconds ( 0 ) ; num . setUTCMilliseconds ( 0 ) ; return num ; break ; case Ext . Date . MONTH : num . setUTCMonth ( num . getUTCMonth ( ) - ( num . getUTCMonth ( ) - 1 ) % step , 1 ) ; num . setUTCHours ( 0 ) ; num . setUTCMinutes ( 0 ) ; num . setUTCSeconds ( 0 ) ; num . setUTCMilliseconds ( 0 ) ; return num ; break ; case Ext . Date . YEAR : num . setUTCFullYear ( num . getUTCFullYear ( ) - num . getUTCFullYear ( ) % step , 1 , 1 ) ; num . setUTCHours ( 0 ) ; num . setUTCMinutes ( 0 ) ; num . setUTCSeconds ( 0 ) ; num . setUTCMilliseconds ( 0 ) ; return date ; break ; } }