processwire/processwire-requests

Add the date formatting feature from PageNames to PageListLabel

Opened this issue · 0 comments

Short description of the enhancement

I'd like to have more options in the Page List Label field for timestamps than the field and fieldStr. It would make sense to incorporate the date:format features from the PageNames custom formatting value to the Page List label value..

Current vs. suggested behavior

If I wanted to include the modified datetime for a page, I am forced to use either:

{modified} - yields the timestamp value, or
{modifiedStr} - yields the datetime format set as the default for the entire site

BUT

{modified:YYYY-mm} - would be great to only include 2023-12

This shouldn't be a hard fix as the code to parse this format already exists in the PageNames class.

Why would the enhancement be useful to users?

This would allow more flexibility in the Page List for including dates and/or time times (Dec 2023) for example.

ALSO

I know these methods are primarily internal, but this page maybe should at least point to the blog post where these features are discussed. Right now it's super buried (essentially you have to follow the link in the admin side.

https://processwire.com/api/ref/pages/names/