Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Chronos
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
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-Chronos
Commits
9fd242f4
Verified
Commit
9fd242f4
authored
5 years ago
by
Nik | Klampfradler
Browse files
Options
Downloads
Patches
Plain Diff
Use new week API in week_helpers. Advances
#27
.
parent
a1631287
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
biscuit/apps/chronos/templatetags/week_helpers.py
+9
-9
9 additions, 9 deletions
biscuit/apps/chronos/templatetags/week_helpers.py
with
9 additions
and
9 deletions
biscuit/apps/chronos/templatetags/week_helpers.py
+
9
−
9
View file @
9fd242f4
...
...
@@ -4,30 +4,30 @@ from typing import Optional
from
django
import
template
from
django.db.models.query
import
QuerySet
from
..util
import
current_week
,
week_days
,
week_weekday_to_date
from
..util
import
CalendarWeek
,
week_weekday_to_date
register
=
template
.
Library
()
@register.filter
def
week_start
(
week
:
int
)
->
date
:
return
week
_days
(
week
)
[
0
]
def
week_start
(
week
:
CalendarWeek
)
->
date
:
return
week
[
0
]
@register.filter
def
week_end
(
week
:
int
)
->
date
:
return
week
_days
(
week
)
[
-
1
]
def
week_end
(
week
:
CalendarWeek
)
->
date
:
return
week
[
-
1
]
@register.filter
def
only_week
(
qs
:
QuerySet
,
week
:
Optional
[
int
])
->
QuerySet
:
wanted_week
=
week
or
current_w
eek
()
return
qs
.
filter
(
week
=
wanted_week
)
def
only_week
(
qs
:
QuerySet
,
week
:
Optional
[
CalendarWeek
])
->
QuerySet
:
wanted_week
=
week
or
CalendarW
eek
()
return
qs
.
filter
(
week
=
wanted_week
.
week
)
@register.simple_tag
def
weekday_to_date
(
week
:
int
,
weekday
:
int
)
->
date
:
def
weekday_to_date
(
week
:
CalendarWeek
,
weekday
:
int
)
->
date
:
return
week_weekday_to_date
(
week
,
weekday
)
...
...
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