diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-04 12:06:19 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-04 12:06:19 +0000 |
commit | 38c79b697f45a949701b9961e87b7c9b8de75abf (patch) | |
tree | bae163aa8d437f74ea4086b93fb6b3c2e0f9013f /app/assets/javascripts/lib | |
parent | 2b7a5214342baa2575b35868316ea9413d2afe1f (diff) | |
download | gitlab-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.js | 10 |
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'; |