Sorting of the subpages by date **AND** time

On the webpage http://www.sav-barchfeld.de/kalender is an event calendar.
How can I achieve a correct sorting of the subpages by date AND time in the panel and the website, because Kirby currently knowns only separate fields for date and time. What do I set in the blueprint of the parent page (the “events” blueprint) as the sorting criterion?

In the “event” blueprint (for the events) I have two fields: (start-) date and time

In the “events” blueprint (for the calendar) I have


    pages:
      sortable: true
      format: Ymd
      num: date

Thanks for your help.

1 Like

It’s currently not possible via blueprints, you can only do it in your templates. There’s a pull request on Github though: https://github.com/getkirby/panel/pull/354

1 Like

[Edit:]
@bastianallgeier and @distantnative:
This issue has been corrected in the current beta (kirby-nightly-2.1.0-20150331160945.zip).

Thank you very much!

My blueprint is now:

pages:
  sortable: true
  format: YmdHi
  sort: date asc time asc
  template:
    - event

This issue can be closed, when v 2.1 is live.

[:edit]

I guess it should be

sort: date time

instead of num

Yes, it should be:

num: date desc time asc

for example

@bastianallgeier and @texnixe

Thanks for your good hints!

But in the panel, now we see a strange numbring of the events.

@HeinerEF What do you mean by strange?

If you find a real issue, you should really head over to Github and post it there.

The sorting is correct, but it shows:

Look at the numbers and which number is in which line.

Until now the date here was displayed, but this sequence of numbers is already strange. Or?

I’m having the same problem with this. The new 2.1 beta lists Fixed Sorting on the changelog but there doesn’t seem to be any info on what has changed!

My pages are split by day, so I all I want to do is have the sort number be the time (from the time field on each page) and then sort them in ascending order.

I can sort them in the right order using: sort: time asc

But no matter what combo of:

num: date
field: time

or

num:
mode: date
field: time

I cannot get it to work! Can anyone shed any light on this?

Tried following the instructions here, but I also cannot get it to work. My blueprint is like this:

title: Blog
pages: 
  template:
    - article
  num: date desc time desc
  format: YmdHi
  sort: flip
  • The format option seems to be ignored - page numbering defaults to numeric.
  • I cannot understand what it’s trying to do with the sorting - it’s all over the place.

Reverted to:

title: Blog
pages: 
  template:
    - article
  num: date
  format: YmdHi
  sort: flip
  • the Hi part of the format are ignored, and pages are listed by Ymd, then alphabetical under the same day.

It should be:

title: Blog
pages:
  num: date
  sort: date asc time asc 

[Edit] The thing that doesn’t make sense to me, is the YmdHi format. As far as I know, Kirby comes with a date field and with a time field, not a combined datetime field. So I wonder if a format YmdHi is correct, because even if I add a time field, I can’t get the folders to show date and time.

So proper sorting in the panel using the sort option will only work if there are both a date and a time field.