ÿþ/ * 
   *   J a v a s c r i p t   H u m a n e   D a t e s 
   *   C o p y r i g h t   ( c )   2 0 0 8   D e a n   L a n d o l t   ( d e a n l a n d o l t . c o m ) 
   *   R e - w r i t e   b y   Z a c h   L e a t h e r m a n   ( z a c h l e a t . c o m ) 
   *   
   *   A d o p t e d   f r o m   t h e   J o h n   R e s i g ' s   p r e t t y . j s 
   *   a t   h t t p : / / e j o h n . o r g / b l o g / j a v a s c r i p t - p r e t t y - d a t e 
   *   a n d   h e n r a h ' s   p r o p o s e d   m o d i f i c a t i o n   
   *   a t   h t t p : / / e j o h n . o r g / b l o g / j a v a s c r i p t - p r e t t y - d a t e / # c o m m e n t - 2 9 7 4 5 8 
   *   
   *   L i c e n s e d   u n d e r   t h e   M I T   l i c e n s e . 
   * /  
 f u n c t i o n   h u m a n e _ d a t e ( d a t e _ s t r ,   l a n g )   {  
         v a r   t i m e _ f o r m a t s ;   v a r   t o k e n ;   i f   ( l a n g   = =   " t r " )   {   t o k e n   =   "   ö n c e " ;   t i m e _ f o r m a t s   =   [ [ 5 ,   ' _u   a n d a ' ] ,   [ 6 0 ,   ' s a n i y e ' ,   1 ] ,   [ 9 0 ,   ' 1   d a k i k a ' ] ,   [ 3 6 0 0 ,   ' d a k i k a ' ,   6 0 ] ,   [ 5 4 0 0 ,   ' 1   s a a t ' ] ,   [ 8 6 4 0 0 ,   ' s a a t ' ,   3 6 0 0 ] ,   [ 1 2 9 6 0 0 ,   ' 1   g ü n ' ] ,   [ 6 0 4 8 0 0 ,   ' g ü n ' ,   8 6 4 0 0 ] ,   [ 9 0 7 2 0 0 ,   ' 1   h a f t a ' ] ,   [ 2 6 2 8 0 0 0 ,   ' h a f t a ' ,   6 0 4 8 0 0 ] ,   [ 3 9 4 2 0 0 0 ,   ' 1   a y ' ] ,   [ 3 1 5 3 6 0 0 0 ,   ' a y ' ,   2 6 2 8 0 0 0 ] ,   [ 4 7 3 0 4 0 0 0 ,   ' 1   y 1l ' ] ,   [ 3 1 5 3 6 0 0 0 0 0 ,   ' y 1l ' ,   3 1 5 3 6 0 0 0 ] ,   [ 4 7 3 0 4 0 0 0 0 0 ,   ' 1   y ü z y 1l ' ] ,   ] ;   }   e l s e  
         {   t o k e n   =   "   a g o " ;   t i m e _ f o r m a t s   =   [ [ 5 ,   ' j u s t   n o w ' ] ,   [ 6 0 ,   ' s e c o n d s ' ,   1 ] ,   [ 9 0 ,   ' 1   m i n u t e ' ] ,   [ 3 6 0 0 ,   ' m i n u t e s ' ,   6 0 ] ,   [ 5 4 0 0 ,   ' 1   h o u r ' ] ,   [ 8 6 4 0 0 ,   ' h o u r s ' ,   3 6 0 0 ] ,   [ 1 2 9 6 0 0 ,   ' 1   d a y ' ] ,   [ 6 0 4 8 0 0 ,   ' d a y s ' ,   8 6 4 0 0 ] ,   [ 9 0 7 2 0 0 ,   ' 1   w e e k ' ] ,   [ 2 6 2 8 0 0 0 ,   ' w e e k s ' ,   6 0 4 8 0 0 ] ,   [ 3 9 4 2 0 0 0 ,   ' 1   m o n t h ' ] ,   [ 3 1 5 3 6 0 0 0 ,   ' m o n t h s ' ,   2 6 2 8 0 0 0 ] ,   [ 4 7 3 0 4 0 0 0 ,   ' 1   y e a r ' ] ,   [ 3 1 5 3 6 0 0 0 0 0 ,   ' y e a r s ' ,   3 1 5 3 6 0 0 0 ] ,   [ 4 7 3 0 4 0 0 0 0 0 ,   ' 1   c e n t u r y ' ] ,   ] ;   }   v a r   t o k e n ;   v a r   t i m e   =   ( ' '   +   d a t e _ s t r ) . r e p l a c e ( / - / g ,   " / " ) . r e p l a c e ( / [ T Z ] / g ,   "   " ) ,   d t   =   n e w   D a t e ,   s e c o n d s   =   ( ( d t   -   n e w   D a t e ( t i m e )   +   ( d t . g e t T i m e z o n e O f f s e t ( )   *   6 0 0 0 0 ) )   /   1 0 0 0 ) ,   t o k e n   =   t o k e n ,   i   =   0 ,   f o r m a t ;   i f   ( s e c o n d s   <   0 )   {   s e c o n d s   =   M a t h . a b s ( s e c o n d s ) ;   t o k e n   =   ' ' ;   }   w h i l e   ( f o r m a t   =   t i m e _ f o r m a t s [ i + + ] )   {   i f   ( s e c o n d s   <   f o r m a t [ 0 ] )   {   i f   ( f o r m a t . l e n g t h   = =   2 )   {   r e t u r n   f o r m a t [ 1 ]   +   ( i   >   1   ?   t o k e n   :   ' ' ) ;   }   e l s e   {   r e t u r n   M a t h . r o u n d ( s e c o n d s   /   f o r m a t [ 2 ] )   +   '   '   +   f o r m a t [ 1 ]   +   ( i   >   1   ?   t o k e n   :   ' ' ) ;   }   }   }   i f   ( s e c o n d s   >   4 7 3 0 4 0 0 0 0 0 )   r e t u r n   M a t h . r o u n d ( s e c o n d s   /   4 7 3 0 4 0 0 0 0 0 )   +   '   C e n t u r i e s '   +   t o k e n ;   r e t u r n   d a t e _ s t r ;  
 } ;   i f   ( t y p e o f   j Q u e r y   ! =   ' u n d e f i n e d ' )   {   j Q u e r y . f n . h u m a n e _ d a t e s   =   f u n c t i o n ( )   {   r e t u r n   t h i s . e a c h ( f u n c t i o n ( )   {   v a r   d a t e   =   h u m a n e _ d a t e ( t h i s . t i t l e ) ;   i f   ( d a t e   & &   j Q u e r y ( t h i s ) . t e x t ( )   ! =   d a t e )   j Q u e r y ( t h i s ) . t e x t ( d a t e ) ;   } ) ;   } ;   } 
