This repository was archived by the owner on Sep 23, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -288,6 +288,12 @@ function format_linked_tasks( array $linkedTasks ): string {
288288 return $ linkedTasks ?: '<em>No tasks</em> ' ;
289289}
290290
291+ function format_duration ( int $ time ): string {
292+ return $ time > 60 ?
293+ floor ( $ time / 60 ) . 'm ' . ( $ time % 60 ) . 's ' :
294+ $ time . 's ' ;
295+ }
296+
291297function shell_echo ( string $ cmd , array $ env = [] ): int {
292298 echo '<pre> ' ;
293299
Original file line number Diff line number Diff line change 348348 '<td data-label="Linked tasks" class="linkedTasks"> ' . $ linkedTasks . '</td> ' .
349349 '<td data-label="Time" class="date"> ' . date ( 'Y-m-d H:i:s ' , $ wikiData [ 'created ' ] ) . '</td> ' .
350350 ( $ 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> ' : '' ) .
352352 ( count ( $ actions ) ?
353353 '<td data-label="Actions"> ' . implode ( ' · ' , $ actions ) . '</td> ' :
354354 '<!-- EMPTY ACTIONS --> '
Original file line number Diff line number Diff line change @@ -576,6 +576,6 @@ static function ( string $repo ) use ( $repos ): bool {
576576$ timeToCreate = time () - $ startTime ;
577577wiki_set_time_to_create ( $ wiki , $ timeToCreate );
578578
579- set_progress ( 100 , 'All done! Wiki created in ' . $ timeToCreate . 's . ' );
579+ set_progress ( 100 , 'All done! Wiki created in ' . format_duration ( $ timeToCreate ) . '. ' );
580580
581581echo '</div> ' ;
You can’t perform that action at this time.
0 commit comments