Skip to content

Commit

Permalink
BC: Calendar
Browse files Browse the repository at this point in the history
  • Loading branch information
JanGalek committed Apr 29, 2018
1 parent 1849e44 commit dc67a02
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ vendor/
composer.lock
!src/Galek/Utils/Exchange/temp/.gitignore
.idea
tests/temp/*
!tests/temp/.gitignore
9 changes: 2 additions & 7 deletions src/Galek/Utils/Exchange/Downloader.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
namespace Galek\Utils\Exchange;

use Galek\Utils\Calendar\Day;
use Nette\Caching\Cache;
use Nette\Caching\Storages\FileStorage;
use Galek\Utils\Calendar\Calendar;
Expand All @@ -13,9 +14,6 @@ final class Downloader
/** @var array */
public $validate;

/** @var string */
private $file;

/** @var Cache */
private $cache;

Expand All @@ -24,6 +22,7 @@ final class Downloader
/**
* [__construct description]
* @param [type] $validate [description]
* @param string $tempDir
* @param [type] $url [description]
*/
public function __construct($validate, $tempDir, $url = null)
Expand Down Expand Up @@ -77,10 +76,6 @@ private function validateTime()
$invalidTime = new Calendar($day.'.'.$m.'.'.$Y.' '.$this->validate[1]);
$invalidTime->add(date_interval_create_from_date_string('5 minutes'));

if (!$invalidTime->isWorkDay()) {
$invalidTime->getWorkDay(true);
}

$diff = strtotime($invalidTime->format('Y-m-d H:i:s')) - strtotime($now->format('Y-m-d H:i:s'));
if ($diff < 0) {
$invalidTime->add(date_interval_create_from_date_string('1 days'));
Expand Down
6 changes: 3 additions & 3 deletions tests/CNB/CNB.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

Debugger::enable(__DIR__ . '/log');

$basic = new \Galek\Utils\Exchange\CNB\Day;
$basic3 = new \Galek\Utils\Exchange\CNB\Day;
$basic = new \Galek\Utils\Exchange\CNB\Day(__DIR__ . '/../temp');
$basic3 = new \Galek\Utils\Exchange\CNB\Day(__DIR__ . '/../temp');
$basic3->setHistory('12.1.2016');

$basic2 = new \Galek\Utils\Exchange\CNB\Other;
$basic2 = new \Galek\Utils\Exchange\CNB\Other(__DIR__ . '/../temp');

//dump($basic->getExchange());
//dump($basic->getExchange(['country', 'Rusko']));
Expand Down
1 change: 1 addition & 0 deletions tests/temp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!.gitignore

0 comments on commit dc67a02

Please sign in to comment.