How do I filter by a date?
I am trying:
.filtered(`workoutDate = "${workoutDate}"`)
and
.filtered(`workoutDate = ${workoutDate.getTime()}`)
but I get You must pass in a date argument to compare
This worked:
.filtered('workoutDate = $0', workoutDate)};
Can someone add an example with $0 to the official docs?
This really needs to be added to the official docs.
It's random that I noticed this comment on a closed issue :-). It's better to create a new issue next time. But I will rephrase the title and reopen. Thanks for reporting this anyway though! :-)
An example exists in https://realm.io/docs/javascript/latest/#queries (search for '$0').
Most helpful comment
This worked: