protected function _calcDateLimit( $timestamp, $skipdays = 0, $businessOnly = false, $publicHolidays = '' )
	{
		$holidays = array();

		if( is_string( $publicHolidays ) && $publicHolidays !== '' )
		{
			$holidays = explode( ',', str_replace( ' ', '', $publicHolidays ) );

			if( sort( $holidays ) === false ) {
				throw new MShop_Service_Exception( sprintf( 'Unable to sort public holidays: "%1$s"', $publicHolidays ) );
			}

			$holidays = array_flip( $holidays );

			for( $i = 0; $i <= $skipdays; $i++ )
			{
				$date = date( 'Y-m-d', $timestamp - $i * 86400 );

				if( isset( $holidays[$date] ) ) {
					$skipdays++;
				}
			}
		}

		if( $businessOnly === true )
		{
			// adds days for weekends
			for( $i = 0; $i <= $skipdays; $i++ )
			{
				$ts = $timestamp - $i * 86400;

				if( date( 'N', $ts ) > 5 && !isset( $holidays[ date( 'Y-m-d', $ts ) ] ) ) {
					$skipdays++;
				}
			}
		}

		return date( 'Y-m-d', $timestamp - $skipdays * 86400 );
	}