if(options?.from && options?.to) {
console.log(options?.from, options?.to);
query.push(
Query.greaterThanEqual("startDate", options.from),
Query.lessThanEqual("endDate", options.to)
);
}
i apply this query but the result it's always empty how can i apply a query on a date?
What is from and to? They should be iso formatted strings
const filterByDate = async function () {
console.log("Calendar Date", calendarDate[0].$d, calendarDate[1].$d);
outOfCityOrderListOptions.startDate = calendarDate[0].$d;
outOfCityOrderListOptions.startDate.setUTCHours(0, 0, 0, 0);
outOfCityOrderListOptions.endDate = calendarDate[1].$d;
outOfCityOrderListOptions.endDate.setUTCHours(23, 59, 59, 999);
const result = (await outOfCityOrderListStore.getAll({
from: outOfCityOrderListOptions.startDate.toISOString(),
to: outOfCityOrderListOptions.endDate.toISOString(),
}) as Store<OutofCityOrderListDto>);
console.log("Result",result);
if(result.data.length === 0 && result.total === 0){
await outOfCityOrderListStore.create({
startDate: outOfCityOrderListOptions.startDate,
endDate: outOfCityOrderListOptions.endDate,
outofCityOrderIds:[]
})
}
};
i converted them to ISOFormat but sometimes it doesn't work sadly
Uhh... Not sure what all that set UTC hours stuff is...assuming you have a date object, all you need to do is call date.toISOString()
thank you that worked for me like that. i thought i should calculate the utc time too for good measurements.
Recommended threads
- I'm getting error Invalid `url` param: I...
``` 2025-10-26T12:52:02.292Z [error] AppwriteException: Invalid `url` param: Invalid URI. Register your new client (vercel.com) as a new Web platform on your pr...
- Unknown column 'sourceSize' in 'field li...
After migrating from 1.6.1 to 1.7.4 I noticed this message in the logs: `appwrite-worker-stats-resources | 2025-10-26T10:32:38.289577112Z Failed: SQLSTATE[...
- Invalid document structure: Missing requ...
After migrating from 1.6.1 to 1.7.4 I noticed this message in the logs: appwrite-worker-audits | 2025-10-26T11:15:24.062537020Z Error processing a...