-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Conversation
@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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use triple ===
There was a problem hiding this comment.
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 ? 😉
There was a problem hiding this comment.
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
06df4ff
to
a18fecb
Compare
🚀 Test PASSed. 🚀 |
Wording-wise it’s fine 👍 :) |
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
a18fecb
to
fdbb68a
Compare
The inspection completed: 7 new issues, 2 updated code elements |
Refer to this link for build results (access rights to CI server needed): 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. 💣 |
Same tests fail as on other branches and they are unrelated. |
Works great 👍 Unit tests looks nice :) Thanks |
Fix formatting of bad dates from external storages
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