]> source.dussan.org Git - nextcloud-server.git/commitdiff
Util::formatDate() expect $timestamp as double
authorBjoern Schiessle <schiessle@owncloud.com>
Wed, 27 Jun 2012 13:05:40 +0000 (15:05 +0200)
committerBjoern Schiessle <schiessle@owncloud.com>
Wed, 27 Jun 2012 13:05:40 +0000 (15:05 +0200)
apps/files_versions/ajax/getVersions.php
apps/files_versions/history.php
apps/files_versions/js/versions.js
apps/files_versions/templates/history.php

index bee6054333977f0a0858b8602f071d60e4a3fc96..96289caec95ecc33301485ef7b162d1f6c50b66b 100644 (file)
@@ -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 );
index cb4726e8d0e735a4e3fc177d489a5e9abb11ffde..ca03de0472bb8b3b6bcfea008cf569211212bb8d 100644 (file)
@@ -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']) ) );
                        
                }
                
index 82d569fa0f6fe7500355d207483a56759455e969..a090fde446e1f96f970154647f1c1b82a4e35df3 100644 (file)
@@ -104,9 +104,9 @@ function createVersionsDropdown(filename, files) {
        }
        
        function addVersion(revision ) {
-               name=formatDate(revision*1000);
+               name=formatDate(revision.version*1000);
                var version=$('<option/>');
-               version.attr('value',revision);
+               version.attr('value',revision.version);
                version.text(name);
                
 //             } else {
index 13e104152b7cffcf0aa1e66446e229ab1a70d150..1b4425564212ebddec4e6f1ca82334b3159d8596 100644 (file)
@@ -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 />';
-               
        }
 
 }