From d5237c42bc0d6f9155629c15904b69b7f60e2e5f Mon Sep 17 00:00:00 2001
From: Bjoern Schiessle <schiessle@owncloud.com>
Date: Wed, 27 Jun 2012 15:05:40 +0200
Subject: [PATCH] Util::formatDate() expect $timestamp as double

---
 apps/files_versions/ajax/getVersions.php  |   4 +---
 apps/files_versions/history.php           |   4 ++--
 apps/files_versions/js/versions.js        | Bin 4366 -> 4382 bytes
 apps/files_versions/templates/history.php |   4 +---
 4 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/apps/files_versions/ajax/getVersions.php b/apps/files_versions/ajax/getVersions.php
index bee60543339..96289caec95 100644
--- a/apps/files_versions/ajax/getVersions.php
+++ b/apps/files_versions/ajax/getVersions.php
@@ -14,9 +14,7 @@ if( OCA_Versions\Storage::isversioned( $source ) ) {
 	$versionsFormatted = array();
 	
 	foreach ( $versions AS $version ) {
-	
-		$versionsFormatted[] = OCP\Util::formatDate( $version );
-		
+		$versionsFormatted[] = OCP\Util::formatDate( doubleval($version) );
 	}
 
 	$versionsSorted = array_reverse( $versions );
diff --git a/apps/files_versions/history.php b/apps/files_versions/history.php
index cb4726e8d0e..ca03de0472b 100644
--- a/apps/files_versions/history.php
+++ b/apps/files_versions/history.php
@@ -38,13 +38,13 @@ if ( isset( $_GET['path'] ) ) {
 			
 			$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 {
 		
 			$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']) ) );
 			
 		}
 		
diff --git a/apps/files_versions/js/versions.js b/apps/files_versions/js/versions.js
index 82d569fa0f6fe7500355d207483a56759455e969..a090fde446e1f96f970154647f1c1b82a4e35df3 100644
GIT binary patch
delta 26
ecmeBEny0kk0xyeRS!&VbGrXQ)#%4jjzf1sxISGOQ

delta 16
YcmbQI)TgxJ0`KG-ysn#7`F=7106Q}VoB#j-

diff --git a/apps/files_versions/templates/history.php b/apps/files_versions/templates/history.php
index 13e104152b7..1b442556421 100644
--- a/apps/files_versions/templates/history.php
+++ b/apps/files_versions/templates/history.php
@@ -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 />');
 	
 	foreach ( $_['versions'] as $v ) {
-	
 		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 />';
 		if ( $v['cur'] ) { echo '  (<b>Current</b>)'; }
 		echo '<br /><br />';
-		
 	}
 
 }
-- 
GitLab