Closed Ev357 closed 11 months ago
Hello, have you try to provide a YML date (format YYYY-MM-DD)? Using the YML date format will return a date.
Hello, have you try to provide a YML date (format YYYY-MM-DD)? Using the YML date format will return a date.
Hello, thank you for your quick reply, you're a lifesaver. I hadn't thought of that. It does work :D
So ig, this issue can be closed right.
@Barbapapazes while the proposed solution works for case with dates what about making it more generic? For example allow users to provide custom 'compareWith' callback instead of mongo-like API or alongside with it?
I'm exploring Nuxt in general and Nuxt Content in particular and this feature sounds like something I can try to make a PR with...
Is your feature request related to a problem? Please describe
I'm making a blog, and i'dlike to sort by posts by date. I have a date in each md post in this format:
DD.MM.YYYY
.Certainly i could do that with the classic
.sort()
, but it would'not work withlimit()
andskip()
. I did some search but i coud'nt find any way to do so withqueryContent()
.Describe the solution you'd like
I'd would be cool to have a custom sorting function, exactly like the
.sort()
.Describe alternatives you've considered
For now i think i'l do it the bad way, i'll get all the posts, sort them, and filter them with manually. I also found nuxt-content-git, but i don't like it that much, and i don't want to add too many dependencies to my project.
Additional context
if I'm doing something wrong, please correct me, i'm always trying to write code as clean as possible, so i'd be grateful for any tips.