Skip to content
Snippets Groups Projects
Commit d5237c42 authored by Björn Schießle's avatar Björn Schießle
Browse files

Util::formatDate() expect $timestamp as double

parent 2d8a380a
No related branches found
No related tags found
No related merge requests found
...@@ -14,9 +14,7 @@ if( OCA_Versions\Storage::isversioned( $source ) ) { ...@@ -14,9 +14,7 @@ if( OCA_Versions\Storage::isversioned( $source ) ) {
$versionsFormatted = array(); $versionsFormatted = array();
foreach ( $versions AS $version ) { foreach ( $versions AS $version ) {
$versionsFormatted[] = OCP\Util::formatDate( doubleval($version) );
$versionsFormatted[] = OCP\Util::formatDate( $version );
} }
$versionsSorted = array_reverse( $versions ); $versionsSorted = array_reverse( $versions );
......
...@@ -38,13 +38,13 @@ if ( isset( $_GET['path'] ) ) { ...@@ -38,13 +38,13 @@ if ( isset( $_GET['path'] ) ) {
$tmpl->assign( 'outcome_stat', 'success' ); $tmpl->assign( 'outcome_stat', 'success' );
$tmpl->assign( 'outcome_msg', "File {$_GET['path']} was reverted to version ".OCP\Util::formatDate( $_GET['revert'] ) ); $tmpl->assign( 'outcome_msg', "File {$_GET['path']} was reverted to version ".OCP\Util::formatDate( doubleval($_GET['revert']) ) );
} else { } else {
$tmpl->assign( 'outcome_stat', 'failure' ); $tmpl->assign( 'outcome_stat', 'failure' );
$tmpl->assign( 'outcome_msg', "File {$_GET['path']} could not be reverted to version ".OCP\Util::formatDate( $_GET['revert'] ) ); $tmpl->assign( 'outcome_msg', "File {$_GET['path']} could not be reverted to version ".OCP\Util::formatDate( doubleval($_GET['revert']) ) );
} }
......
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
...@@ -20,13 +20,11 @@ if( isset( $_['message'] ) ) { ...@@ -20,13 +20,11 @@ if( isset( $_['message'] ) ) {
echo('<p><em>Revert a file to a previous version by clicking on its revert button</em></p><br />'); echo('<p><em>Revert a file to a previous version by clicking on its revert button</em></p><br />');
foreach ( $_['versions'] as $v ) { foreach ( $_['versions'] as $v ) {
echo ' '; echo ' ';
echo OCP\Util::formatDate( $v['version'] ); echo OCP\Util::formatDate( doubleval($v['version']) );
echo ' <a href="'.OCP\Util::linkTo('files_versions', 'history.php').'?path='.urlencode( $_['path'] ).'&revert='. $v['version'] .'" class="button">Revert</a><br /><br />'; echo ' <a href="'.OCP\Util::linkTo('files_versions', 'history.php').'?path='.urlencode( $_['path'] ).'&revert='. $v['version'] .'" class="button">Revert</a><br /><br />';
if ( $v['cur'] ) { echo ' (<b>Current</b>)'; } if ( $v['cur'] ) { echo ' (<b>Current</b>)'; }
echo '<br /><br />'; echo '<br /><br />';
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment