extended-yellow
extended-yellow5mo ago

How can I get all records that were created this calender month.

I would like to get the amount of records that were created this month after calling useTable.
3 Replies
kapa.ai
kapa.ai5mo ago
Hi @blackbearftw. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Hmm, I don't know enough to give you a confident answer yet. However, you can use the filters feature of the useTable hook to filter your data based on the createdAt field. You would need to set up a filter that checks if the createdAt date of each record is within the current calendar month. Unfortunately, the exact implementation would depend on the format of your createdAt field and the capabilities of your server-side filtering logic. For more information on how to use filters with useTable, you can check out the refine documentation (https://refine.dev/docs/core/hooks/use-table#filtering). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai5mo ago
<@490961337896402944> kapa.ai is still learning and improving, please let us know how it did by reacting below
subsequent-cyan
subsequent-cyan5mo ago
Hello @blackbearftw you can pass filters to your data hook (useTable, useList etc..) to get events created this month. If you want to get total count of events created this month, it depends on your API response. You can handle API response in your data provider.