Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-DashboardFeeds
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-App-DashboardFeeds
Commits
3b1490c9
You need to sign in or sign up before continuing.
Verified
Commit
3b1490c9
authored
4 years ago
by
Jonathan Weth
Browse files
Options
Downloads
Patches
Plain Diff
Replace format by f-strings
parent
0c0ea007
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aleksis/apps/dashboardfeeds/util/event_feed.py
+4
-5
4 additions, 5 deletions
aleksis/apps/dashboardfeeds/util/event_feed.py
with
4 additions
and
5 deletions
aleksis/apps/dashboardfeeds/util/event_feed.py
+
4
−
5
View file @
3b1490c9
...
...
@@ -38,21 +38,20 @@ def get_current_events(calendar: Calendar, limit: int = 5) -> list:
if
not
event
.
all_day
:
# No all day event
formatted
+=
"
"
+
begin_time_formatted
formatted
+=
f
"
{
begin_time_formatted
}
"
if
event
.
begin
.
time
!=
event
.
end
.
time
():
# Event has an end time
formatted
+=
"
–
"
+
end_time_formatted
formatted
+=
f
"
–
{
end_time_formatted
}
"
else
:
# Event is on multiple days
if
event
.
all_day
:
# Event is all day
formatted
=
"
{
} – {}
"
.
format
(
begin_date_formatted
,
end_date_formatted
)
formatted
=
f
"
{
begin_date_formatted
}
–
{
end_date_formatted
}
"
else
:
# Event has begin and end times
formatted
=
"
{} {} – {} {}
"
.
format
(
begin_date_formatted
,
begin_time_formatted
,
end_date_formatted
,
end_time_formatted
)
formatted
=
f
"
{
begin_date_formatted
}
{
begin_time_formatted
}
–
{
end_date_formatted
}
{
end_time_formatted
}
"
events
.
append
({
"
name
"
:
event
.
name
,
...
...
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