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
- Invalid document structure: missing requ...
I just pick up my code that's working a week ago, and now I got this error: ``` code: 400, type: 'document_invalid_structure', response: { message: 'Inv...
- custom domain with CloudFlare
Hi all, it seems that CloudFlare has blocked cross-domain CNAME link which made my app hostname which is in CloudFlare, unable to create a CNAME pointing to clo...
- Type Mismatch in AppwriteException
There is a discrepancy in the TypeScript type definitions for AppwriteException. The response property is defined as a string in the type definitions, but in pr...