Jump to content

How to change the published date format in find lister


Recommended Posts

On 25/07/2017 at 11:45 PM, Mirza said:

Can we change the date format to yyyy-mm-dd or any other?

Currently you cannot.  There is a @todo note in the code:

// @todo make this format customizable via wireDate()


Edit: you cannot set the date format individually for the 'created', 'modified' and 'published' columns, but if you don't mind using the same format for all you can use this hook in /site/ready.php:

$wire->addHookBefore('ProcessPageLister::execute', function(HookEvent $event) {
    $lister = $event->object;
    $lister->nativeDateFormat = 'Y-m-d';
    // see https://processwire.com/api/ref/datetime/date/ for format options


  • Like 3
Link to comment
Share on other sites

  • 2 months later...

Recently I am fixing this issue, again, and I find this post in google. There's another solution that I found in the ListerPro forum before. The created, modified, publish date format can be changed via language translation. The language support module has to be installed in this case.

Go to Setting > Language > choose the language you use > Click Find Files to Translate button > click /wire\modules\Process\ProcessPageLister\ProcessPageLister.module and submit > translate "rel" field(should be listed on top) to wanted format like Y-m-d

Reference: https://github.com/processwire/processwire/blob/57b297fd1d828961b20ef29782012f75957d6886/wire/modules/Process/ProcessPageLister/ProcessPageLister.module#L238

  • Like 3
Link to comment
Share on other sites

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.
  • Similar Content

    • By michelangelo
      Hello guys,
      I have an issue that might be solved with the Lister module or ListerPro. I don't want to order the paid module if it's not necessary. That's why I wanted to ask first.
      I have multiple images that my client wants to be able to go through and categorise them. The structure in a lister looks like this:

      The "Category Reference" is related to a few categories that are in multiple groups:

      I would like to have those options show up in the Lister and be able to quickly select them.
      This is how the categories look like in the Image page itself:

      Is there a way to do it with the built in PW modules? I just want to have the table-like view in the lister and in the "Category references" to have my three options "Cloth, China, Surgical".

    • By Robin S
      Lister Selector
      A Process module that uses Lister/ListerPro, but with a selector string input instead of the normal InputfieldSelector filters.
      For power users, typing a selector string is often faster and more intuitive than fiddling with InputfieldSelector. It also lets you copy/paste selector strings that you might be using somewhere else in your code.
      Allows the Lister rows to be sorted by multiple fields (not possible in Lister/ListerPro)
      Allows the use of OR-groups (not possible in Lister/ListerPro)
      If ListerPro is installed you can run ListerPro actions on the listed pages - the available actions are defined in the module config.
      Bookmarks can be configured in the module config and accessed via the flyout menu for the module page. For your convenience you can copy/paste a bookmark string from the note at the bottom of the Lister Selector results.
      Type your selector string on the Selector tab. The selector is applied when the "Selector string" field is blurred, so hit Tab when you have finished typing your selector.
      Unlike Lister/ListerPro, you can't sort results by clicking the column headings. Control the sort within the selector string instead.
      Superusers can jump to the module config (e.g. to create a bookmark) by clicking the cog icon at the top right of the module interface.
      The module is mostly intended for use by superusers, because in most cases site editors won't understand the ProcessWire selector string syntax. If you want another role to be able to access Lister Selector then give the role the "lister-selector" permission. Only superusers can define bookmarks because in ProcessWire module config screens are only accessible to superusers.
      Process page

      Module config (when ListerPro is installed)

      If for any reason you want to create dynamic bookmark links to Lister Selector for a given selector you can do that like this:
      /** @var $pls ProcessListerSelector */ $pls = $modules->get('ProcessListerSelector'); // Define selector $selector = "template=foo, title%=bar"; // Define columns (optional) $columns = 'title,modified'; $pls_link = $pls->getProcessPage()->url . '?bm=' . $pls->urlSafeBase64Encode($selector . ':' . $columns); echo "<a href='$pls_link'>My link</a>";  
    • By MarkE
      I have been making use of the ProcessPageLister::addSessionBookmark() method to create drill-downs of financial data in a table - so that the user can see the pages comprising the amount in the table cell. This works really well and has been well-received by the client. However, I soon ran into a problem in that the method sets $maxBookmarks = 30;  hard-coded just like that. I changed the code to $maxBookmarks = 400; and haven't noticed any ill-effects so far, so some questions arise:
      Why is it hard-coded rather than modifiable? If the answer to (1) is because too many bookmarks cause a problem, what is the problem? If there is no particular problem with more than 30 bookmarks, is there any other practical limit? Clearly changing the code in my copy of PW is not a good idea as it will get over-written at the next update. Is there a way of dealing with this until (if ever) the variable can be modified through the API?
    • By Robin S
      Inputfield Selector Select ID
      Uses the Page List Select inputfield for user-friendly input of page IDs into Inputfield Selector.
      This module adds a feature to Inputfield Selector, which is most commonly seen in Lister (Find) and Lister Pro.
      When adding a filter row for "Parent", "Has parent/ancestor" or "ID" the user is expected to enter a page ID to match against. But this is not as user-friendly as it could be because the user may be able to identify the desired page by its title or location in the tree but not know its ID. This is particularly the case for site editors who may not even understand the concept of a page ID.
      So this module adds a thunderbolt icon to relevant rows in Inputfield Selector. When the icon is clicked a Page List Select inputfield opens in a modal window, allowing the user to visually select a page from the tree. When the modal is closed with "OK" the ID of the selected page is inserted into the filter row.

      After a page selection has been made in the modal window the "OK" button will automatically receive focus so if you prefer you can close the modal by hitting the Enter key rather than mousing to the OK button.
      Install the Inputfield Selector Select ID module.
    • By LAPS
      I bookmarked a number of custom Listers (path: /admin/page/lister) and I have some doubts on how to use them.
      In particular, I would like to link a custom Lister page in front-end content. I could make this by inserting a link within the body field (CKEditor) of a my page and using the URL of the Lister (e.g. /admin/page/lister/?bookmark=1514677991) so to render a linked text in the front-end.
      My doubt: is the use of that URL the right way for linking text to a Lister?
      I also would like to access the title data of the custom Lister in order to output the title as linked text in the front-end.
      How can I do that (note: I am using the Hanna Code module for my body field)?
      I have not found the relevant documentation that serves my case.
  • Create New...