Fakultas Ilmu Komputer UI

Commit 0412aa3a authored by Sean Zeliq Urian's avatar Sean Zeliq Urian
Browse files

[REFACTOR] fix date precision

parent 2048883b
......@@ -53,9 +53,16 @@ export default function ActivityList() {
ignoreDateFilterQuery: boolean
) => {
let dateOnly = {
start_date: dateFilterQuery.start_date.toISOString().split('T')[0],
end_date: dateFilterQuery.end_date.toISOString().split('T')[0],
start_date: new Date(
dateFilterQuery.start_date.valueOf() + 1000 * 3600 * 24
)
.toISOString()
.split('T')[0],
end_date: new Date(dateFilterQuery.end_date.valueOf() + 1000 * 3600 * 24)
.toISOString()
.split('T')[0],
};
setIsLoading(true);
const logResponse = await services.main.getLog(
page,
......@@ -65,10 +72,7 @@ export default function ActivityList() {
ignoreDateFilterQuery
);
console.log(logResponse);
let logs: Log[] = [];
console.log(logResponse.data.results);
if (
logResponse.data.results !== undefined &&
logResponse.data.results.length > 0
......
......@@ -34,9 +34,16 @@ export default function ActivityTabel() {
ignoreDateFilterQuery: boolean
) => {
let dateOnly = {
start_date: dateFilterQuery.start_date.toISOString().split('T')[0],
end_date: dateFilterQuery.end_date.toISOString().split('T')[0],
start_date: new Date(
dateFilterQuery.start_date.valueOf() + 1000 * 3600 * 24
)
.toISOString()
.split('T')[0],
end_date: new Date(dateFilterQuery.end_date.valueOf() + 1000 * 3600 * 24)
.toISOString()
.split('T')[0],
};
const logResponse = await services.main.getLog(
page,
roleFilterQuery,
......
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