Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
d4633b0e
Commit
d4633b0e
authored
Sep 27, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add latest changes from gitlab-org/gitlab@master
parent
2abb1b54
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
6 deletions
+15
-6
app/assets/javascripts/lib/utils/datetime_utility.js
app/assets/javascripts/lib/utils/datetime_utility.js
+6
-2
app/views/admin/runners/index.html.haml
app/views/admin/runners/index.html.haml
+1
-1
spec/frontend/lib/utils/datetime_utility_spec.js
spec/frontend/lib/utils/datetime_utility_spec.js
+8
-3
No files found.
app/assets/javascripts/lib/utils/datetime_utility.js
View file @
d4633b0e
...
...
@@ -555,5 +555,9 @@ export const calculateRemainingMilliseconds = endDate => {
* @param {number} daysInPast number of days that are subtracted from a given date
* @returns {String} Date string in ISO format
*/
export
const
getDateInPast
=
(
date
,
daysInPast
)
=>
new
Date
(
date
.
setTime
(
date
.
getTime
()
-
daysInPast
*
24
*
60
*
60
*
1000
)).
toISOString
();
export
const
getDateInPast
=
(
date
,
daysInPast
)
=>
{
const
dateClone
=
newDate
(
date
);
return
new
Date
(
dateClone
.
setTime
(
dateClone
.
getTime
()
-
daysInPast
*
24
*
60
*
60
*
1000
),
).
toISOString
();
};
app/views/admin/runners/index.html.haml
View file @
d4633b0e
...
...
@@ -43,7 +43,7 @@
.row
.col-sm-9
=
form_tag
admin_runners_path
,
id:
'runners-search'
,
method: :get
,
class:
'filter-form js-filter-form'
do
.filtered-search-wrapper
.filtered-search-wrapper
.d-flex
.filtered-search-box
=
dropdown_tag
(
custom_icon
(
'icon_history'
),
options:
{
wrapper_class:
'filtered-search-history-dropdown-wrapper'
,
...
...
spec/frontend/lib/utils/datetime_utility_spec.js
View file @
d4633b0e
...
...
@@ -428,11 +428,16 @@ describe('newDate', () => {
});
describe
(
'
getDateInPast
'
,
()
=>
{
const
date
=
new
Date
(
1563235200000
);
// 2019-07-16T00:00:00.000Z;
const
daysInPast
=
90
;
it
(
'
returns the correct date in the past
'
,
()
=>
{
const
date
=
new
Date
(
1563235200000
);
// 2019-07-16T00:00:00.00Z
const
daysInPast
=
90
;
const
dateInPast
=
datetimeUtility
.
getDateInPast
(
date
,
daysInPast
);
expect
(
dateInPast
).
toBe
(
'
2019-04-17T00:00:00.000Z
'
);
});
it
(
'
does not modifiy the original date
'
,
()
=>
{
datetimeUtility
.
getDateInPast
(
date
,
daysInPast
);
expect
(
date
).
toStrictEqual
(
new
Date
(
1563235200000
));
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment