Change date format in panel

I have an articles page that I’m sorting via date.

pages: true
   template: video
   num: date
   sort: date asc

which returns:

My question: is there a way to change this date format MM/DD/YYYY across the entire panel? I understand how those changes would be made in the template, but I couldn’t dig up an example of this change in the panel.

If you really need to change this, you would have to manipulate the panel core code …

- sigh -

That’s what I thought.

For anyone stumbling over this thread including future-me:
It’s (now?) possible to change the date format in the panel by using the display option.

18

pages:
  num:
    mode:        date
    display:     d.m.Y
2 Likes

Guys, this page in the docs seems to have incorrect information. It is advising us that if we want date-ordered pages in the Panel to show using specially formatted dates, we should use a ‘format’ option, like this (straight from the docs):

…
 pages:
   num:
     mode: date
     field: added
     format: YmdHi
…

It seems we should be using ‘display’ instead of ‘format’, like this:

…
 pages:
   num:
     mode: date
     field: added
     display: YmdHi
…

There are in fact two options:

  • format: is used for the date prefix in the file system (folder name)
  • display: is used for displaying the date in the Panel Sidebar/Pages View

The second option was undocumented, but I just added it.

(The date field itself also has a format option. This format option, however, refers to how the date is displayed in the date field, not how it is saved to file.)

2 Likes

Thank you for the explanation, @texnixe - and for being so prompt with the update! Wow!!!