I have a a Date type of a field in my collection schema. I need to search and query only the items of a specific day in the month that the user chooses (From a date picker in Android) . I’m passing a LocalDate to that function. after user selection. Now my question is, how can I make a query with that LocalDate type, in order to get the right information?
override fun filterDieariesByDate(localDate: LocalDate) {
...
realm.query<Diary>("ownerId == $0 AND date < $1",
user.identity,
"${localDate.year}-${localDate.month}-${localDate.dayOfMonth}"
)
...
}
But I’m getting an error: Unsupported comparison between type ‘timestamp’ and type ‘string’.
Can someone please point me in the right direction? Also it would be great to have some more docs about querying a date.