From ac542fbf4923ce6b4a48ddaff0ad776696b0928d Mon Sep 17 00:00:00 2001 From: Tomasz Dobrowolski Date: Thu, 8 Mar 2018 15:54:43 -0500 Subject: [PATCH] fix moment-utils startOfDay, endOfDay The two methods in moment-utils invoke moment().startOf and moment().endOf which mutate the original value. The call to clone() has to be added in order to prevent that. --- lib/src/utils/moment-utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/utils/moment-utils.js b/lib/src/utils/moment-utils.js index a499e3ea0..592b4a8f5 100644 --- a/lib/src/utils/moment-utils.js +++ b/lib/src/utils/moment-utils.js @@ -40,11 +40,11 @@ export default class MomentUtils { } static startOfDay(date) { - return date.startOf('day'); + return date.clone().startOf('day'); } static endOfDay(date) { - return date.endOf('day'); + return date.clone().endOf('day'); } static format(date, formatString) {