Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix formatting of bad dates from external storages #12639

Merged
merged 1 commit into from
Dec 13, 2014

Conversation

RobinMcCorkell
Copy link
Member

When getting a bad mtime for a file (such as for FTP directories), the Modified time will be replaced with ? and the tooltip will contain 'Unable to determine date'. Fixes #6395

@karlitschek
Copy link
Contributor

@PVince81 What do you think?

@@ -1229,7 +1229,11 @@ OC.Util = {
* @returns {string} human readable difference from now
*/
relativeModifiedDate: function (timestamp) {
return moment(timestamp).fromNow();
if (timestamp == 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use triple ===

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if the file is legitimately from the EPOCH date ? 😉

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, I keep forgetting that JS has triple equality

@RobinMcCorkell RobinMcCorkell force-pushed the bad_mtime_format branch 2 times, most recently from 06df4ff to a18fecb Compare December 5, 2014 18:11
@ghost
Copy link

ghost commented Dec 5, 2014

🚀 Test PASSed. 🚀
Refer to this link for build results (access rights to CI server needed):
https://ci.owncloud.org//job/pull-request-analyser-ng-simple/3880/
🚀 Test PASSed. 🚀

@nickvergessen nickvergessen added this to the 8.0-current milestone Dec 8, 2014
@RobinMcCorkell
Copy link
Member Author

cc @jancborchardt

@jancborchardt
Copy link
Member

Wording-wise it’s fine 👍 :)

@PVince81
Copy link
Contributor

Works and looks good.

@Xenopathic next challenge is to add a JS unit test for that case here https://github.com/owncloud/core/blob/master/apps/files/tests/js/filelistSpec.js#L258

Tooltip contains 'Unable to determine date'. Fixes #6395
@scrutinizer-notifier
Copy link

The inspection completed: 7 new issues, 2 updated code elements

@ghost
Copy link

ghost commented Dec 13, 2014

Refer to this link for build results (access rights to CI server needed):
https://ci.owncloud.org//job/pull-request-analyser-ng-simple/4447/

Build result: FAILURE

[...truncated 16 lines...]Fetching upstream changes from https://github.com/owncloud/core.gitusing GIT_SSH to set credentials using .gitcredentials to set credentials > git config --local credential.helper store --file=/tmp/git8093197678700711798.credentials # timeout=10 > git fetch --tags --progress https://github.com/owncloud/core.git +refs/pull/:refs/remotes/origin/pr/ > git config --local --remove-section credential # timeout=10 > git rev-parse origin/pr/12639/merge^{commit} # timeout=10 > git branch -a --contains 3e6e8fbba0688b2005420ba6c689a62d11ce42cf # timeout=10 > git rev-parse remotes/origin/pr/12639/merge^{commit} # timeout=10Checking out Revision 3e6e8fbba0688b2005420ba6c689a62d11ce42cf (origin/pr/12639/merge) > git config core.sparsecheckout # timeout=10 > git checkout -f 3e6e8fbba0688b2005420ba6c689a62d11ce42cfFirst time build. Skipping changelog. > git remote # timeout=10 > git submodule init # timeout=10 > git submodule sync # timeout=10 > git config --get remote.origin.url # timeout=10 > git submodule update --init --recursiveTriggering pull-request-analyser-ng-simple » SLAVEpull-request-analyser-ng-simple » SLAVE completed with result FAILUREStarted calculate disk usage of buildFinished Calculation of disk usage of build in 0 secondsStarted calculate disk usage of workspaceFinished Calculation of disk usage of workspace in 3 second
💣 Test FAILed. 💣

@MorrisJobke
Copy link
Contributor

Same tests fail as on other branches and they are unrelated.

@MorrisJobke
Copy link
Contributor

Works great 👍 Unit tests looks nice :) Thanks

MorrisJobke added a commit that referenced this pull request Dec 13, 2014
Fix formatting of bad dates from external storages
@MorrisJobke MorrisJobke merged commit 5b3971f into master Dec 13, 2014
@MorrisJobke MorrisJobke deleted the bad_mtime_format branch December 13, 2014 09:07
DeepDiver1975 added a commit that referenced this pull request Aug 14, 2017
DeepDiver1975 added a commit that referenced this pull request Aug 15, 2017
@lock lock bot locked as resolved and limited conversation to collaborators Aug 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mounted FTP shows wrong change date ("Years ago" - 01.01.1970)
8 participants