summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-10-05 16:02:52 +0100
committerPhil Hughes <me@iamphill.com>2016-10-05 16:02:52 +0100
commitea2f9a6083b584a2e5050628ff17bed3c0576222 (patch)
treed34bfd50bc402c65466b04ffe9532300980aadfe
parent796f531f2b4de62eac3db41835e56080520eaa48 (diff)
downloadgitlab-ce-build-expire-sidebar.tar.gz
Correctly parse the date of artifact expiringbuild-expire-sidebar
Previously it was just replacing dashes which would remove the timezone offset causing the date to be invalid Closes #19600
-rw-r--r--app/assets/javascripts/build.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/assets/javascripts/build.js b/app/assets/javascripts/build.js
index 78d21c0552a..f336bfc36d6 100644
--- a/app/assets/javascripts/build.js
+++ b/app/assets/javascripts/build.js
@@ -146,7 +146,7 @@
$date = $('.js-artifacts-remove');
if ($date.length) {
date = $date.text();
- return $date.text($.timefor(new Date(date.replace(/-/g, '/')), ' '));
+ return $date.text($.timefor(new Date(date.replace(/([0-9]+)-([0-9]+)-([0-9]+)/g, '$1/$2/$3')), ' '));
}
};