Jump to content

Recommended Posts

Posted

Hi,

i have a problem that drives me crazy.

In a project i have pages (template concert) with a DateTime Field "date_time" (output is "d.m.Y" for date and "H:i" for time, "d.m.Y H:i" for date and time).

When i use this selector:

$items = $pages->find('template=concert,sort=date_time,date_time>=today');

i get all the concerts in the right order by date. But inside a date, the concerts are not ordered by time. It looks like a random order to me.

As far as i know, the datetime field uses a timestamp. So why is the order wrong? Why are the items only ordered by date?

Is that a bug or am i missing somehing? I've spent nearly hours to seach for this topic, read documentation of selectors, the cheatsheet and even looked inside the datetimefieldtype code but could not find a solution.

Posted

Sorry, I've found a mistake on my side. I adjusted the output and did not see, that i added some hours before the output of the dates so every date was wrong. Sometimes it is good, to stop working for some hours, when such simple errors happen. Processwire works just fine and as aspected. My brain did not.

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...