From 38c79b697f45a949701b9961e87b7c9b8de75abf Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Mon, 4 Nov 2019 12:06:19 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- app/assets/javascripts/lib/utils/datetime_utility.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'app/assets/javascripts/lib') 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'; -- cgit v1.2.1