summaryrefslogtreecommitdiff
path: root/jstests/aggregation/sources/densify/libs/densify_in_js.js
diff options
context:
space:
mode:
authorTed Tuckman <ted.tuckman@mongodb.com>2021-10-05 13:41:45 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-10-05 15:01:05 +0000
commitd6790e0ebc3a484a83e107536940d11780460d6f (patch)
treee1268533300eef19ed7228ffbaaba3f27d0035f6 /jstests/aggregation/sources/densify/libs/densify_in_js.js
parent0d18dab404e4649c054666e5787000154c7e42c0 (diff)
downloadmongo-d6790e0ebc3a484a83e107536940d11780460d6f.tar.gz
SERVER-52290 Remove featureFlagDensify
Diffstat (limited to 'jstests/aggregation/sources/densify/libs/densify_in_js.js')
-rw-r--r--jstests/aggregation/sources/densify/libs/densify_in_js.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/jstests/aggregation/sources/densify/libs/densify_in_js.js b/jstests/aggregation/sources/densify/libs/densify_in_js.js
index 48b63298499..4c92bd572bc 100644
--- a/jstests/aggregation/sources/densify/libs/densify_in_js.js
+++ b/jstests/aggregation/sources/densify/libs/densify_in_js.js
@@ -13,18 +13,18 @@ load("jstests/aggregation/extras/utils.js"); // arrayEq
*/
const makeArithmeticHelpers = (unitName, factor) => {
const getter = date => {
- const newDate = new Date(date);
+ const newDate = new ISODate(date.toISOString());
// Calling the proper function on the passed in date object. If the unitName was "Seconds"
// would be equivalent to `newDate.getSeconds()`.
- return newDate["get" + unitName]();
+ return newDate["getUTC" + unitName]();
};
// Return a new date with the proper unit adjusted with the second parameter.
// Dates and the setter helpers are generally mutable, but this function will make sure
// the arithmetic helpers won't mutate their inputs.
const setter = (date, newComponent) => {
- const newDate = new Date(date);
- newDate["set" + unitName](newComponent);
+ const newDate = new ISODate(date.toISOString());
+ newDate["setUTC" + unitName](newComponent);
return newDate;
};