This repository was archived by the owner on Sep 23, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -288,6 +288,12 @@ function format_linked_tasks( array $linkedTasks ): string {
288
288
return $ linkedTasks ?: '<em>No tasks</em> ' ;
289
289
}
290
290
291
+ function format_duration ( int $ time ): string {
292
+ return $ time > 60 ?
293
+ floor ( $ time / 60 ) . 'm ' . ( $ time % 60 ) . 's ' :
294
+ $ time . 's ' ;
295
+ }
296
+
291
297
function shell_echo ( string $ cmd , array $ env = [] ): int {
292
298
echo '<pre> ' ;
293
299
Original file line number Diff line number Diff line change 348
348
'<td data-label="Linked tasks" class="linkedTasks"> ' . $ linkedTasks . '</td> ' .
349
349
'<td data-label="Time" class="date"> ' . date ( 'Y-m-d H:i:s ' , $ wikiData [ 'created ' ] ) . '</td> ' .
350
350
( $ useOAuth ? '<td data-label="Creator"> ' . ( $ creator ? user_link ( $ creator ) : '? ' ) . '</td> ' : '' ) .
351
- ( $ canAdmin ? '<td data-label="Time to create"> ' . ( $ wikiData ['timeToCreate ' ] ? $ wikiData ['timeToCreate ' ] . ' s ' : '' ) . '</td> ' : '' ) .
351
+ ( $ canAdmin ? '<td data-label="Time to create"> ' . ( $ wikiData ['timeToCreate ' ] ? format_duration ( $ wikiData ['timeToCreate ' ] ) : '' ) . '</td> ' : '' ) .
352
352
( count ( $ actions ) ?
353
353
'<td data-label="Actions"> ' . implode ( ' · ' , $ actions ) . '</td> ' :
354
354
'<!-- EMPTY ACTIONS --> '
Original file line number Diff line number Diff line change @@ -576,6 +576,6 @@ static function ( string $repo ) use ( $repos ): bool {
576
576
$ timeToCreate = time () - $ startTime ;
577
577
wiki_set_time_to_create ( $ wiki , $ timeToCreate );
578
578
579
- set_progress ( 100 , 'All done! Wiki created in ' . $ timeToCreate . 's . ' );
579
+ set_progress ( 100 , 'All done! Wiki created in ' . format_duration ( $ timeToCreate ) . '. ' );
580
580
581
581
echo '</div> ' ;
You can’t perform that action at this time.
0 commit comments