summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/lib
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-11-04 12:06:19 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-11-04 12:06:19 +0000
commit38c79b697f45a949701b9961e87b7c9b8de75abf (patch)
treebae163aa8d437f74ea4086b93fb6b3c2e0f9013f /app/assets/javascripts/lib
parent2b7a5214342baa2575b35868316ea9413d2afe1f (diff)
downloadgitlab-ce-38c79b697f45a949701b9961e87b7c9b8de75abf.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/lib')
-rw-r--r--app/assets/javascripts/lib/utils/datetime_utility.js10
1 files changed, 3 insertions, 7 deletions
diff --git a/app/assets/javascripts/lib/utils/datetime_utility.js b/app/assets/javascripts/lib/utils/datetime_utility.js
index e2d188103bc..e9d8d0a4184 100644
--- a/app/assets/javascripts/lib/utils/datetime_utility.js
+++ b/app/assets/javascripts/lib/utils/datetime_utility.js
@@ -553,14 +553,10 @@ export const calculateRemainingMilliseconds = endDate => {
*
* @param {Date} date the date that we will substract days from
* @param {number} daysInPast number of days that are subtracted from a given date
- * @returns {String} Date string in ISO format
+ * @returns {Date} Date in past as Date object
*/
-export const getDateInPast = (date, daysInPast) => {
- const dateClone = newDate(date);
- return new Date(
- dateClone.setTime(dateClone.getTime() - daysInPast * 24 * 60 * 60 * 1000),
- ).toISOString();
-};
+export const getDateInPast = (date, daysInPast) =>
+ new Date(newDate(date).setDate(date.getDate() - daysInPast));
export const beginOfDayTime = 'T00:00:00Z';
export const endOfDayTime = 'T23:59:59Z';