I am trying to get entries with a date smaller than now.
`
{{ $paginator := .Paginate (where .Site.Pages “Type” ($.Scratch.Get “area”)) $elementstoload }}
{{ range where $paginator.Pages .Date.Unix “<” .Now.Unix }}
`
When i dont use the “where” and “date” stuff in the range, i get all entries.
So what am i doing wrong?
bep
2
Try:
{{ range where $paginator.Pages "Date" "<" "Now" }}
{{ range where $paginator.Pages "Date" "<" .Now }}
this seems to work!
So this is my working way:
`
{{ $selectedpages := where .Site.Pages “Type” “whatever” }}
{{ $paginator := .Paginate (where $selectedpages “Date.Unix” “<” .Now.Unix) xxx }}
`
It’s not working for me. Is there any way to convert custom date string inside map[] to Unix timestamp on the fly in where clause?
Something like:
{{ where .items “(time date).Unix” “>” .Now.Unix }}
Or:
{{ where .items (time “date”).Unix “>” .Now.Unix }}
But I’ve tried many combinations without luck.