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
- rxdb integration code not working
https://appwrite.io/blog/post/offline-first-journal This code does not work with rxdb and appwrite packages set to february releases nor newest releases
- Costom domain Issues
Hi Appwrite team We’re having issues verifying a custom domain. We added the required CNAME and CAA records to our DNS provider and waited for at least 2 days a...
- No domain visible after creating functio...
Saw this in docs yet i have no domain (Pro): ``` Generated domains In the Appwrite Console's sidebar, click Functions. Under the Domains tab, you'll find the g...