Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-ora2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-ora2
Commits
5db4f40b
Commit
5db4f40b
authored
Mar 25, 2014
by
Stephen Sanchez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding additional comments to the format_datetime function.
parent
42119c6a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
apps/openassessment/xblock/openassessmentblock.py
+8
-5
No files found.
apps/openassessment/xblock/openassessmentblock.py
View file @
5db4f40b
...
@@ -380,20 +380,23 @@ class OpenAssessmentBlock(
...
@@ -380,20 +380,23 @@ class OpenAssessmentBlock(
context
=
Context
(
context_dict
)
context
=
Context
(
context_dict
)
return
Response
(
template
.
render
(
context
),
content_type
=
'application/html'
,
charset
=
'UTF-8'
)
return
Response
(
template
.
render
(
context
),
content_type
=
'application/html'
,
charset
=
'UTF-8'
)
def
format_datetime_string
(
self
,
datetime
):
def
format_datetime_string
(
self
,
datetime
_str
):
"""Takes a datetime string, and formats it to be a user facing time.
"""Takes a datetime string, and formats it to be a user facing time.
Format a datetime string to be user facing.
Format a datetime string to be user facing. Datetimes are stored as
strings in the XBlock configuration for an assessment module. This
function is used to get back the Datetime object for rendering the start
and due dates on the front end.
Args:
Args:
datetime
(str): A ISO formatted Datetime String, to be converted to
datetime
_str (str): A ISO formatted Datetime String, to be converted
a datetime object with UTC timezone.
to
a datetime object with UTC timezone.
Returns:
Returns:
datetime with UTC timezone from the given string.
datetime with UTC timezone from the given string.
"""
"""
return
dateutil
.
parser
.
parse
(
unicode
(
datetime
))
.
replace
(
tzinfo
=
pytz
.
utc
)
return
dateutil
.
parser
.
parse
(
unicode
(
datetime
_str
))
.
replace
(
tzinfo
=
pytz
.
utc
)
def
add_xml_to_node
(
self
,
node
):
def
add_xml_to_node
(
self
,
node
):
"""
"""
...
...
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