Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
Hsin-Yu Chien
edx-platform-release
Commits
f624b2c9
Unverified
Commit
f624b2c9
authored
5 years ago
by
Jeff LaJoie
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #23361 from edx/jlajoie/local-time-for-dates-tab
Uses user local time for dates tab
parents
f395e5f5
bbfb630a
No related branches found
Branches containing commit
Tags
release-2020-03-10-17.21
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lms/djangoapps/courseware/views/views.py
+9
-0
9 additions, 0 deletions
lms/djangoapps/courseware/views/views.py
lms/templates/courseware/dates.html
+6
-1
6 additions, 1 deletion
lms/templates/courseware/dates.html
with
15 additions
and
1 deletion
lms/djangoapps/courseware/views/views.py
+
9
−
0
View file @
f624b2c9
...
...
@@ -131,6 +131,7 @@ from xmodule.modulestore.exceptions import ItemNotFoundError, NoPathToItem
from
xmodule.tabs
import
CourseTabList
from
xmodule.x_module
import
STUDENT_VIEW
from
..context_processor
import
user_timezone_locale_prefs
from
..entrance_exams
import
user_can_skip_entrance_exam
from
..module_render
import
get_module
,
get_module_by_usage_id
,
get_module_for_descriptor
...
...
@@ -1050,6 +1051,12 @@ def dates(request, course_id):
include_access
=
True
,
include_past_dates
=
True
)
enrollment
=
get_enrollment
(
request
.
user
.
username
,
course_id
)
learner_is_verified
=
False
# User locale settings
user_timezone_locale
=
user_timezone_locale_prefs
(
request
)
user_timezone
=
user_timezone_locale
[
'
user_timezone
'
]
user_language
=
user_timezone_locale
[
'
user_language
'
]
if
enrollment
:
learner_is_verified
=
enrollment
.
get
(
'
mode
'
)
==
'
verified
'
...
...
@@ -1058,6 +1065,8 @@ def dates(request, course_id):
'
course_date_blocks
'
:
[
block
for
block
in
course_date_blocks
if
block
.
title
!=
'
current_datetime
'
],
'
verified_upgrade_link
'
:
verified_upgrade_deadline_link
(
request
.
user
,
course
=
course
),
'
learner_is_verified
'
:
learner_is_verified
,
'
user_timezone
'
:
user_timezone
,
'
user_language
'
:
user_language
,
}
return
render_to_response
(
'
courseware/dates.html
'
,
context
)
...
...
This diff is collapsed.
Click to expand it.
lms/templates/courseware/dates.html
+
6
−
1
View file @
f624b2c9
...
...
@@ -2,6 +2,7 @@
<
%
inherit
file=
"/main.html"
/>
<
%
namespace
name=
'static'
file=
'/static_content.html'
/>
<
%!
from
django.utils.translation
import
ugettext
as
_
from
lms.djangoapps.courseware.date_summary
import
CourseAssignmentDate
,
VerificationDeadlineDate
,
VerifiedUpgradeDeadlineDate
from
openedx.core.djangolib.markup
import
HTML
,
Text
...
...
@@ -36,7 +37,7 @@ from openedx.core.djangolib.markup import HTML, Text
<div
class=
"timeline-date-content"
>
% if block.date:
<div
class=
"timeline-date"
>
${block.date.strftime(block.date_format)}
<div
class=
"course-date localized_datetime"
aria-hidden=
"true"
data-format=
"shortDate"
data-datetime=
"${block.date}"
data-language=
"${user_language}"
data-timezone=
"${user_timezone}"
></div>
</div>
% if active:
<div
class=
"pill due"
>
${_('Due Today')}
</div>
...
...
@@ -71,3 +72,7 @@ from openedx.core.djangolib.markup import HTML, Text
</div>
</div>
</main>
<
%
static:require_module_async
module_name=
"js/dateutil_factory"
class_name=
"DateUtilFactory"
>
DateUtilFactory.transform(iterationKey=".localized_datetime");
</
%
static:require_module_async>
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