]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix files UI mtime parsing from webdav
authorVincent Petry <pvince81@owncloud.com>
Wed, 16 Dec 2015 16:44:16 +0000 (17:44 +0100)
committerVincent Petry <pvince81@owncloud.com>
Wed, 16 Dec 2015 16:44:16 +0000 (17:44 +0100)
core/js/files/client.js
core/js/tests/specs/files/clientSpec.js

index 608c2702fbbb5baa9fb37cdf1027783a4f15e3f9..8854ee0c8098f16ec6140886863ae6dcc2f595bf 100644 (file)
                                id: props['{' + Client.NS_OWNCLOUD + '}fileid'],
                                path: OC.dirname(path) || '/',
                                name: OC.basename(path),
-                               mtime: new Date(props['{' + Client.NS_DAV + '}getlastmodified'])
+                               mtime: (new Date(props['{' + Client.NS_DAV + '}getlastmodified'])).getTime()
                        };
 
                        var etagProp = props['{' + Client.NS_DAV + '}getetag'];
index 3a3181d842636e669e54af6668406ddba848db53..61cff0a66ecd255de485d33854e66120844ff5a5 100644 (file)
@@ -252,7 +252,7 @@ describe('OC.Files.Client tests', function() {
                                expect(info.name).toEqual('One.txt');
                                expect(info.permissions).toEqual(31);
                                expect(info.size).toEqual(250);
-                               expect(info.mtime.getTime()).toEqual(1436535485000);
+                               expect(info.mtime).toEqual(1436535485000);
                                expect(info.mimetype).toEqual('text/plain');
                                expect(info.etag).toEqual('559fcabd79a38');
 
@@ -264,7 +264,7 @@ describe('OC.Files.Client tests', function() {
                                expect(info.name).toEqual('sub');
                                expect(info.permissions).toEqual(31);
                                expect(info.size).toEqual(100);
-                               expect(info.mtime.getTime()).toEqual(1436536800000);
+                               expect(info.mtime).toEqual(1436536800000);
                                expect(info.mimetype).toEqual('httpd/unix-directory');
                                expect(info.etag).toEqual('66cfcabd79abb');
                        });
@@ -295,7 +295,7 @@ describe('OC.Files.Client tests', function() {
                                expect(info.name).toEqual('文件夹');
                                expect(info.permissions).toEqual(31);
                                expect(info.size).toEqual(120);
-                               expect(info.mtime.getTime()).toEqual(1436522405000);
+                               expect(info.mtime).toEqual(1436522405000);
                                expect(info.mimetype).toEqual('httpd/unix-directory');
                                expect(info.etag).toEqual('56cfcabd79abb');
 
@@ -376,7 +376,7 @@ describe('OC.Files.Client tests', function() {
                                expect(info.name).toEqual('文件夹');
                                expect(info.permissions).toEqual(31);
                                expect(info.size).toEqual(120);
-                               expect(info.mtime.getTime()).toEqual(1436522405000);
+                               expect(info.mtime).toEqual(1436522405000);
                                expect(info.mimetype).toEqual('httpd/unix-directory');
                                expect(info.etag).toEqual('56cfcabd79abb');
                        });
@@ -425,7 +425,7 @@ describe('OC.Files.Client tests', function() {
                                expect(info.name).toEqual('in root');
                                expect(info.permissions).toEqual(31);
                                expect(info.size).toEqual(120);
-                               expect(info.mtime.getTime()).toEqual(1436522405000);
+                               expect(info.mtime).toEqual(1436522405000);
                                expect(info.mimetype).toEqual('httpd/unix-directory');
                                expect(info.etag).toEqual('56cfcabd79abb');
                        });