ÿþ< ! - -   P a s t e   t h i s   c o d e   i n t o   a n   e x t e r n a l   J a v a S c r i p t   f i l e   n a m e d :   d a t e D i f f . j s     - - >  
  
 / *   T h i s   s c r i p t   a n d   m a n y   m o r e   a r e   a v a i l a b l e   f r e e   o n l i n e   a t  
 T h e   J a v a S c r i p t   S o u r c e   : :   h t t p : / / j a v a s c r i p t . i n t e r n e t . c o m  
 C r e a t e d   b y :   J a v a S c r i p t   D e m o s   : :   h t t p : / / w w w . j a v a s c r i p t - d e m o s . c o m /   * /  
  
 f u n c t i o n   c a l c D a y s ( ) {  
     v a r   d a t e 1   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' d 1 ' ) . l a s t C h i l d . d a t a ;  
     v a r   d a t e 2   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' d 2 ' ) . l a s t C h i l d . d a t a ;  
     d a t e 1   =   d a t e 1 . s p l i t ( " - " ) ;  
     d a t e 2   =   d a t e 2 . s p l i t ( " - " ) ;  
     v a r   s D a t e   =   n e w   D a t e ( d a t e 1 [ 0 ] + " / " + d a t e 1 [ 1 ] + " / " + d a t e 1 [ 2 ] ) ;  
     v a r   e D a t e   =   n e w   D a t e ( d a t e 2 [ 0 ] + " / " + d a t e 2 [ 1 ] + " / " + d a t e 2 [ 2 ] ) ;  
     v a r   d a y s A p a r t   =   M a t h . a b s ( M a t h . r o u n d ( ( s D a t e - e D a t e ) / 8 6 4 0 0 0 0 0 ) ) ;  
     d o c u m e n t . g e t E l e m e n t B y I d ( ' d i f f D a y s ' ) . l a s t C h i l d . d a t a   =   d a y s A p a r t ;  
 }  
  
 o n l o a d = c a l c D a y s ; 
