I discovered that the function in our ReactJS app component which returns a MomentJS, it was realized that the object is mutable and any time you call, an attribute of the object it mutates object was returning a different moment of time each time it was called by a source. After some debugging and reading documentation of . In order to fix the issue, you must clone the moment object by either calling on the object itself or encapsulating the moment object in another moment object such as
Here is the signature for the function:
momentUtc = moment().utc()
HWe utilized cloning within our app component using:
chartsDate = moment(startOfWorkWeek(0, 0))
publishedChart = createWorkflow(
MomentJS objects are mutable which means any function that you call on that object changes the state of that object which can cause varying results. Cloning creates a copy of the object, and in this example when we created our variable, chartsDate, we cloned startOfWorkWeek by calling moment() on it using moment(startOfWorkWeek).