Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iqdevTranningProgram
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Адлан Шамавов
iqdevTranningProgram
Merge requests
!5
Ptps controller 5
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Ptps controller 5
PTPS_Controller_5
into
main
Overview
4
Commits
14
Pipelines
0
Changes
4
Merged
Адлан Шамавов
requested to merge
PTPS_Controller_5
into
main
11 months ago
Overview
4
Commits
14
Pipelines
0
Changes
4
Expand
0
0
Merge request reports
Compare
main
version 10
da409f72
11 months ago
version 9
da409f72
11 months ago
version 8
4938b336
11 months ago
version 7
dfbee921
11 months ago
version 6
dfbee921
11 months ago
version 5
8ee9ca86
11 months ago
version 4
5727e87f
11 months ago
version 3
5727e87f
11 months ago
version 2
3da16093
11 months ago
version 1
b4966b44
11 months ago
main (base)
and
latest version
latest version
ea083e60
14 commits,
11 months ago
version 10
da409f72
11 commits,
11 months ago
version 9
da409f72
16 commits,
11 months ago
version 8
4938b336
15 commits,
11 months ago
version 7
dfbee921
13 commits,
11 months ago
version 6
dfbee921
23 commits,
11 months ago
version 5
8ee9ca86
22 commits,
11 months ago
version 4
5727e87f
20 commits,
11 months ago
version 3
5727e87f
22 commits,
11 months ago
version 2
3da16093
6 commits,
11 months ago
version 1
b4966b44
4 commits,
11 months ago
4 files
+
43
−
11
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
4
Search (e.g. *.vue) (Ctrl+P)
src/Action/Functions.php
+
16
−
0
Options
@@ -4,6 +4,9 @@ declare(strict_types=1);
namespace
App\Action
;
use
Exception
;
use
DateTimeImmutable
;
class
Functions
{
/**
@@ -84,4 +87,17 @@ class Functions
}
return
$result
;
}
/**
* Функция рассчитывает кол-во дней до нового года
* @param DateTimeImmutable $date дата от которой, необходимо рассчитать кол-во дней
* @return int
* @throws Exception
*/
public
function
howDaysToNy
(
DateTimeImmutable
$date
):
int
{
$endYear
=
date
(
"Y-12-31"
,
date_timestamp_get
(
$date
));
$dateInterval
=
date_diff
(
new
DateTimeImmutable
(
$endYear
),
$date
);
return
(
int
)
$dateInterval
->
format
(
"%a"
)
+
1
;
}
}
\ No newline at end of file
Loading