Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
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-platform
Commits
865b6936
Commit
865b6936
authored
Jun 02, 2014
by
polesye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BLD-1060: Fix RelativeTime.
parent
ee368da6
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
0 deletions
+13
-0
CHANGELOG.rst
+2
-0
common/lib/xmodule/xmodule/js/spec/time_spec.js
+7
-0
common/lib/xmodule/xmodule/js/src/time.js
+4
-0
No files found.
CHANGELOG.rst
View file @
865b6936
...
...
@@ -5,6 +5,8 @@ These are notable changes in edx-platform. This is a rolling list of changes,
in roughly chronological order, most recent first. Add your entries at or near
the top. Include a label indicating the component affected.
Blades: Fix bug with incorrect RelativeTime value after XML serialization. BLD-1060
LMS: Update bulk email implementation to lessen load on the database
by consolidating chunked queries for recipients into a single query.
...
...
common/lib/xmodule/xmodule/js/spec/time_spec.js
View file @
865b6936
...
...
@@ -3,6 +3,13 @@
describe
(
'Time'
,
function
()
{
describe
(
'format'
,
function
()
{
describe
(
'with NAN'
,
function
()
{
it
(
'return a correct time format'
,
function
()
{
expect
(
Time
.
format
(
'string'
)).
toEqual
(
'0:00'
);
expect
(
Time
.
format
(
void
(
0
))).
toEqual
(
'0:00'
);
});
});
describe
(
'with duration more than or equal to 1 hour'
,
function
()
{
it
(
'return a correct time format'
,
function
()
{
expect
(
Time
.
format
(
3600
)).
toEqual
(
'1:00:00'
);
...
...
common/lib/xmodule/xmodule/js/src/time.js
View file @
865b6936
...
...
@@ -12,6 +12,10 @@
function
format
(
time
,
formatFull
)
{
var
hours
,
minutes
,
seconds
;
if
(
!
_
.
isFinite
(
time
))
{
time
=
0
;
}
seconds
=
Math
.
floor
(
time
);
minutes
=
Math
.
floor
(
seconds
/
60
);
hours
=
Math
.
floor
(
minutes
/
60
);
...
...
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