PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.10
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.10
4.4.10 4.4.9.1 4.4.9 4.4.8 4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 All 142 releases
← All changes | assets/src/apps/js/frontend/quiz/components/duration/index.js +24 -24 4.3.9 → 4.4.10 View file →
@@ -1,24 +1,24 @@
1 -const formatDuration = ( seconds ) => {
2 - let d;
3 -
4 - const dayInSeconds = 3600 * 24;
5 -
6 - if ( seconds > dayInSeconds ) {
7 - d = ( seconds - ( seconds % dayInSeconds ) ) / dayInSeconds;
8 - seconds = seconds % dayInSeconds;
9 - } else if ( seconds == dayInSeconds ) {
10 - return '24:00';
11 - }
12 -
13 - const x = ( new Date( seconds * 1000 ).toUTCString() ).match( /\d{2}:\d{2}:\d{2}/ )[ 0 ].split( ':' );
14 -
15 - if ( d ) {
16 - x[ 0 ] = parseInt( x[ 0 ] ) + ( d * 24 );
17 - }
18 -
19 - const html = x.join( ':' );
20 -
21 - return html;
22 -};
23 -
24 -export default formatDuration;
1 +const formatDuration = ( seconds ) => {
2 + let d;
3 +
4 + const dayInSeconds = 3600 * 24;
5 +
6 + if ( seconds > dayInSeconds ) {
7 + d = ( seconds - ( seconds % dayInSeconds ) ) / dayInSeconds;
8 + seconds = seconds % dayInSeconds;
9 + } else if ( seconds == dayInSeconds ) {
10 + return '24:00';
11 + }
12 +
13 + const x = ( new Date( seconds * 1000 ).toUTCString() ).match( /\d{2}:\d{2}:\d{2}/ )[ 0 ].split( ':' );
14 +
15 + if ( d ) {
16 + x[ 0 ] = parseInt( x[ 0 ] ) + ( d * 24 );
17 + }
18 +
19 + const html = x.join( ':' );
20 +
21 + return html;
22 +};
23 +
24 +export default formatDuration;