Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
uw_cfg_common
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor 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
WCMS
uw_cfg_common
Commits
9fe9e208
Commit
9fe9e208
authored
3 years ago
by
Eric Bremner
Committed by
Igor Biki
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
ISTWCMS-4917: adding check for only upcoming dates
parent
0900504e
No related branches found
No related tags found
1 merge request
!118
Feature/istwcms 4917 ebremner upcoming dates
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Service/UWService.php
+21
-24
21 additions, 24 deletions
src/Service/UWService.php
with
21 additions
and
24 deletions
src/Service/UWService.php
+
21
−
24
View file @
9fe9e208
...
@@ -611,32 +611,29 @@ class UWService implements UWServiceInterface {
...
@@ -611,32 +611,29 @@ class UWService implements UWServiceInterface {
// out correct values.
// out correct values.
foreach
(
$dates
as
$date
)
{
foreach
(
$dates
as
$date
)
{
// The all day case, duration is always 1439.
// Ensure that the dates are greater than now, before
if
(
$date
[
'duration'
]
==
'1439'
&&
$date
[
'end_value'
]
>
strtotime
(
"now"
))
{
// adding it to the dates array.
$return_dates
[]
=
date
(
'l, F j, Y'
,
$date
[
'value'
])
.
' (all day)'
;
if
(
$date
[
'end_value'
]
>
strtotime
(
"now"
))
{
}
else
{
// The all day case, duration is always 1439.
if
(
$date
[
'duration'
]
==
'1439'
)
{
// If the date is upcoming, meaning greater than right now.
$return_dates
[]
=
date
(
'l, F j, Y'
,
$date
[
'value'
])
.
' (all day)'
;
// Taking this out for now, will be putting it back, if
}
else
{
// we figure out how to do this in the view.
// if ($date['end_value'] > strtotime("today")) {.
// If this is the same day, get the date and the start
// If this is the same day, get the date and the start
// and end times.
// and end times.
if
(
$date
[
'duration'
]
<
'1439'
)
{
if
(
$date
[
'duration'
]
<
'1439'
)
{
$start_date
=
date
(
'l, F j, Y g:i A'
,
$date
[
'value'
]);
$start_date
=
date
(
'l, F j, Y g:i A'
,
$date
[
'value'
]);
$end_date
=
date
(
'g:i A'
,
$date
[
'end_value'
]);
$end_date
=
date
(
'g:i A'
,
$date
[
'end_value'
]);
}
// This is not the day, get the start and end date with time.
}
else
{
$start_date
=
date
(
'l, F j, Y g:i A'
,
$date
[
'value'
]);
$end_date
=
date
(
'l, F j, Y g:i A'
,
$date
[
'end_value'
]);
}
// This is not the day, get the start and end date with time.
// Add the start and end date with timezone.
else
{
$return_dates
[]
=
$start_date
.
' - '
.
$end_date
.
' '
.
date
(
'T'
,
$date
[
'end_value'
]);
$start_date
=
date
(
'l, F j, Y g:i A'
,
$date
[
'value'
]);
$end_date
=
date
(
'l, F j, Y g:i A'
,
$date
[
'end_value'
]);
}
}
// Add the start and end date with timezone.
$return_dates
[]
=
$start_date
.
' - '
.
$end_date
.
' '
.
date
(
'T'
,
$date
[
'end_value'
]);
// }
}
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment