fix date
This commit is contained in:
@@ -443,17 +443,6 @@ const uniqueAccounts = computed(() => {
|
||||
return accounts.map((acc) => ({ name: acc, id: acc })); // usa anche `id` se serve per la picklist
|
||||
});
|
||||
|
||||
// Filter progetti per account selezionato
|
||||
// const filteredProjects = computed(() => {
|
||||
// if (!projectOptions.value) return []
|
||||
// let filteredList = projectOptions.value
|
||||
|
||||
// if (selectedAccount.value) {
|
||||
// filteredList = filteredList.filter(p => p.account === selectedAccount.value.name)
|
||||
// }
|
||||
|
||||
// return filteredList;
|
||||
// })
|
||||
|
||||
const onPage = (event) => {
|
||||
currentPageExecutions.value = event.page + 1;
|
||||
@@ -533,9 +522,20 @@ const exportAggregations = () => {
|
||||
document.body.removeChild(link);
|
||||
};
|
||||
|
||||
// const exportChats = () => {
|
||||
// if (chatTable.value) chatTable.value.exportCSV()
|
||||
// }
|
||||
const formatLocalDate = (date) => {
|
||||
if (!date) return null;
|
||||
const year = date.getFullYear();
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(date.getDate()).padStart(2, '0');
|
||||
return `${year}-${month}-${day}`;
|
||||
};
|
||||
|
||||
const formatLocalDateTo = (date) => {
|
||||
if (!date) return null;
|
||||
const nextDay = new Date(date);
|
||||
nextDay.setDate(nextDay.getDate() + 1);
|
||||
return formatLocalDate(nextDay);
|
||||
};
|
||||
|
||||
// Caricamento dati con filtri
|
||||
const loadData = async () => {
|
||||
@@ -543,8 +543,8 @@ const loadData = async () => {
|
||||
try {
|
||||
const filterParams = {
|
||||
// Date
|
||||
dateFrom: dateRange.value?.[0] ? dateRange.value[0].toISOString().split('T')[0] : null,
|
||||
dateTo: dateRange.value?.[1] ? dateRange.value[1].toISOString().split('T')[0] : null,
|
||||
dateFrom: formatLocalDate(dateRange.value?.[0]),
|
||||
dateTo: null ? formatLocalDateTo(dateRange.value?.[0]):formatLocalDateTo(dateRange.value?.[1]),
|
||||
|
||||
account: selectedAccount.value || null,
|
||||
|
||||
@@ -558,33 +558,6 @@ const loadData = async () => {
|
||||
})
|
||||
.filter(Boolean)
|
||||
: [],
|
||||
|
||||
// // Applicazioni
|
||||
// applicationIds: selectedApplications.value.length
|
||||
// ? selectedApplications.value.map(id => String(id))
|
||||
// : [],
|
||||
// applicationNames: selectedApplications.value.length
|
||||
// ? selectedApplications.value
|
||||
// .map(id => {
|
||||
// const app = appOptions.value.find(a => a.id === id)
|
||||
// return app ? app.fe_name : null
|
||||
// })
|
||||
// .filter(Boolean)
|
||||
// : [],
|
||||
|
||||
// // Utenti
|
||||
// userIds: selectedUsers.value.length
|
||||
// ? selectedUsers.value.map(id => String(id))
|
||||
// : [],
|
||||
// userNames: selectedUsers.value.length
|
||||
// ? selectedUsers.value
|
||||
// .map(id => {
|
||||
// const user = userOptions.value.find(u => u.id === id)
|
||||
// return user ? user.username : null
|
||||
// })
|
||||
// .filter(Boolean)
|
||||
// : [],
|
||||
|
||||
// Scenari
|
||||
scenarioIds: selectedScenarios.value.length ? selectedScenarios.value.map((id) => String(id)) : [],
|
||||
scenarioNames: selectedScenarios.value.length
|
||||
@@ -600,8 +573,8 @@ const loadData = async () => {
|
||||
console.log('Filter parameters:', filterParams);
|
||||
|
||||
const chatParams = {
|
||||
dateFrom: dateRange.value?.[0] ? dateRange.value[0].toISOString().split('T')[0] : null,
|
||||
dateTo: dateRange.value?.[1] ? dateRange.value[1].toISOString().split('T')[0] : null,
|
||||
dateFrom: formatLocalDate(dateRange.value?.[0]),
|
||||
dateTo: null ? formatLocalDateTo(dateRange.value?.[0]):formatLocalDateTo(dateRange.value?.[1]),
|
||||
projectIds: selectedProjects.value.length ? selectedProjects.value.map((id) => String(id)) : [],
|
||||
projectNames: selectedProjects.value.length
|
||||
? selectedProjects.value
|
||||
|
||||
Reference in New Issue
Block a user