Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
MOOC packages by hacklab
django-courses
Commits
eae1e2be
Commit
eae1e2be
authored
May 18, 2021
by
Matheus Miranda
Browse files
Update hour format
parent
a0b8abcc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
courses/reports/serializers.py
courses/reports/serializers.py
+1
-1
courses/reports/views.py
courses/reports/views.py
+1
-1
No files found.
courses/reports/serializers.py
View file @
eae1e2be
...
@@ -151,7 +151,7 @@ class UserStatsSerializer(serializers.ModelSerializer):
...
@@ -151,7 +151,7 @@ class UserStatsSerializer(serializers.ModelSerializer):
from
django.utils
import
timezone
from
django.utils
import
timezone
tz_str
=
timezone
.
localtime
(
timestamp
)
tz_str
=
timezone
.
localtime
(
timestamp
)
date
,
hour
=
tz_str
.
strftime
(
'%d-%m-%Y %H:%M:%S'
).
split
()
date
,
hour
=
tz_str
.
strftime
(
'%d-%m-%Y %H:%M:%S'
).
split
()
return
'{}
às
{}'
.
format
(
date
,
hour
)
return
'{}
/
{}'
.
format
(
date
,
hour
)
else
:
else
:
return
''
return
''
...
...
courses/reports/views.py
View file @
eae1e2be
...
@@ -351,7 +351,7 @@ class UserAccessView(views.APIView):
...
@@ -351,7 +351,7 @@ class UserAccessView(views.APIView):
from
django.utils
import
timezone
from
django.utils
import
timezone
tz_str
=
timezone
.
localtime
(
timestamp
)
tz_str
=
timezone
.
localtime
(
timestamp
)
date
,
hour
=
tz_str
.
strftime
(
'%d-%m-%Y %H:%M:%S'
).
split
()
date
,
hour
=
tz_str
.
strftime
(
'%d-%m-%Y %H:%M:%S'
).
split
()
return
'{}
às
{}'
.
format
(
date
,
hour
)
return
'{}
/
{}'
.
format
(
date
,
hour
)
def
get
(
self
,
request
,
format
=
None
):
def
get
(
self
,
request
,
format
=
None
):
user_id
=
request
.
GET
[
'user'
]
user_id
=
request
.
GET
[
'user'
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment