Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Maják
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
Container registry
Model registry
Operate
Environments
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
TO
Maják
Commits
ad7d9ac2
Commit
ad7d9ac2
authored
3 years ago
by
jan.bednarik
Browse files
Options
Downloads
Patches
Plain Diff
calendar utils: Split events shifted by 2h
parent
b9eee398
Branches
Branches containing commit
No related tags found
2 merge requests
!347
release
,
!346
calendar utils: Split events shifted by 2h
Pipeline
#4833
passed
3 years ago
Stage: build
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
calendar_utils/parser.py
+3
-3
3 additions, 3 deletions
calendar_utils/parser.py
with
3 additions
and
3 deletions
calendar_utils/parser.py
+
3
−
3
View file @
ad7d9ac2
...
@@ -18,9 +18,9 @@ def parse_ical(source):
...
@@ -18,9 +18,9 @@ def parse_ical(source):
def
split_events
(
events
):
def
split_events
(
events
):
"""
Splits events and returns list of past events and future events.
"""
"""
Splits events and returns list of past events and future events.
"""
now
=
arrow
.
utcnow
()
singularity
=
arrow
.
utcnow
()
.
shift
(
hours
=-
2
)
past
=
[
ev
for
ev
in
events
if
ev
[
"
end
"
]
<
now
]
past
=
[
ev
for
ev
in
events
if
ev
[
"
end
"
]
<
singularity
]
future
=
[
ev
for
ev
in
events
if
ev
[
"
end
"
]
>
now
]
future
=
[
ev
for
ev
in
events
if
ev
[
"
end
"
]
>
singularity
]
return
past
,
future
return
past
,
future
...
...
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