add "to" date to the export_issues method; updated strings to eng
This commit is contained in:
parent
9e38ed5a90
commit
94542ea555
2 changed files with 62 additions and 28 deletions
|
@ -88,7 +88,7 @@ class GiteaApiController extends Controller
|
|||
return $datetime->format('Y-m-d H:i:s');
|
||||
}
|
||||
|
||||
private function export_issues(string $from_date, array $issues_params)
|
||||
private function export_issues(string $from_date, string $to_date, array $issues_params)
|
||||
{
|
||||
$data = array();
|
||||
$repositories = $this->get_repositories();
|
||||
|
@ -96,7 +96,8 @@ class GiteaApiController extends Controller
|
|||
$issues = $this->get_issues($repository['name'], $issues_params);
|
||||
foreach ($issues as $issue) {
|
||||
$from_datetime = $this->date_to_datetime($from_date);
|
||||
if (substr($issue['closed_at'], 0, 19) > $from_datetime) {
|
||||
$to_datetime = $this->date_to_datetime($to_date);
|
||||
if (substr($issue['closed_at'], 0, 19) > $from_datetime && substr($issue['closed_at'], 0, 19) <= $to_datetime) {
|
||||
$data[] = $this->create_columns($issue);
|
||||
}
|
||||
}
|
||||
|
@ -111,8 +112,9 @@ class GiteaApiController extends Controller
|
|||
if ($req->input('token') != getenv('GITEA_TOKEN')) {
|
||||
return redirect('/');
|
||||
}
|
||||
$date = $req->input('year') . '-' . $req->input('month') . '-01';
|
||||
$this->export_issues($date, ['state' => 'closed']);
|
||||
$from = $req->input('from_year') . '-' . $req->input('from_month') . '-01';
|
||||
$to = $req->input('to_year') . '-' . $req->input('to_month') . '-31';
|
||||
$this->export_issues($from, $to, ['state' => 'closed']);
|
||||
return view('backend', [
|
||||
'token' => getenv('GITEA_TOKEN')
|
||||
]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue