public static function getSpan( BaseDateTime $date1, BaseDateTime $date2,
        $type = self::SPAN_HOURS, $absolute = TRUE
    )
    {
        $diff = $date1->diff( $date2, $absolute );

        $span = 0;
        
        switch( $type )
        {
            case self::SPAN_YEARS:
                $span = ( int )$diff->y;
                break;
            
            case self::SPAN_MONTHS:
                $span  = $diff->y * 12;
                $span += $diff->m;
                $span  = ( int )$span;
                break;
            
            case self::SPAN_WEEKS:
                $span += $diff->days;
                $span  = ( int )( $span / 7 );
                break;
            
            case self::SPAN_DAYS:
                $span = ( int )$diff->days;
                break;
            
            case self::SPAN_HOURS:
                $span  = ( $diff->days * 24 );
                $span += $diff->h;
                $span  = ( int )$span;
                break;
            
            case self::SPAN_MINUTES:
                $span  = ( $diff->days * 24 );
                $span += $diff->h;
                $span  = ( $span * 60 );
                $span += $diff->i;
                $span  = ( int )$span;
                break;
            
            case self::SPAN_SECONDS:
                $span  = ( $diff->days * 24 );
                $span += $diff->h;
                $span  = ( $span * 60 );
                $span += $diff->i;
                $span  = ( int )( $span * 60 );
                $span += $diff->s;
                break;
            
            default:
                $span = FALSE;
                break;
        }
        
        if ( FALSE === $span )
        {
            return $span;
        }
        
        if ( 1 == $diff->invert )
        {
            return ( $span * -1 );
        }
        
        return $span;
    }