Unverified Commit d1ca4e6b authored by Chelsea Shaw's avatar Chelsea Shaw Committed by GitHub
Browse files

Update query params sent to activity endpoint so that they aren't rounded...

Update query params sent to activity endpoint so that they aren't rounded incorrectly (#10322) (#10326)
parent daadba9e
Showing with 3 additions and 3 deletions
+3 -3
import Route from '@ember/routing/route';
import ClusterRoute from 'vault/mixins/cluster-route';
import { hash } from 'rsvp';
import { endOfMonth } from 'date-fns';
import { format, addDays } from 'date-fns';
import { parseDateString } from 'vault/helpers/parse-date-string';
const getActivityParams = ({ start, end }) => {
......@@ -12,14 +12,14 @@ const getActivityParams = ({ start, end }) => {
let startDate = parseDateString(start);
if (startDate) {
// TODO: Replace with formatRFC3339 when date-fns is updated
params.start_time = Math.round(startDate.getTime() / 1000);
params.start_time = format(addDays(startDate, 1), 'X');
}
}
if (end) {
let endDate = parseDateString(end);
if (endDate) {
// TODO: Replace with formatRFC3339 when date-fns is updated
params.end_time = Math.round(endOfMonth(endDate).getTime() / 1000);
params.end_time = format(addDays(endDate, 10), 'X');
}
}
return params;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment