Robin S Posted January 13, 2022 Share Posted January 13, 2022 Lister Native Date Format Allows the date format for "created", "modified" and "published" columns to be set within a Lister or Lister Pro instance. Why? Lister formats the "created", "modified" and "published" columns as relative time strings and doesn't provide an easy way to change this without writing code. Sometimes a value like "3 weeks ago" is not precise enough and you want to see an exact date/time in these columns, perhaps only temporarily before switching back to a relative date. Details An icon is added near the top right of the Lister that reveals a dropdown where you can select from a list date formats that you define in the module config. The Lister will remember your chosen date format the next time you visit the Lister. If you have Lister Pro installed then each Lister Pro instance will remember the date format previously set for that instance. Configuration In the "Date options" field in the module config, enter a list of date formats that are compatible with wireDate(), one format per line. The default date format used by Lister is "rel". You can also set a default date format for native fields which will apply to all Listers that haven't yet had a date format chosen from the dropdown. https://github.com/Toutouwai/ListerNativeDateFormathttps://processwire.com/modules/lister-native-date-format/ 9 Link to comment Share on other sites More sharing options...
adrian Posted January 13, 2022 Share Posted January 13, 2022 Damn I love what you do! 1 Link to comment Share on other sites More sharing options...
adrian Posted January 13, 2022 Share Posted January 13, 2022 Now I am going to be annoying and ask if it would be difficult to set a default format. Maybe by setting the default as the first option entered in the Date Options config setting? Link to comment Share on other sites More sharing options...
Robin S Posted January 13, 2022 Author Share Posted January 13, 2022 2 hours ago, adrian said: Now I am going to be annoying and ask if it would be difficult to set a default format. I added a config field for this in v0.1.1. Let me know if this wasn't what you were getting at. 3 Link to comment Share on other sites More sharing options...
adrian Posted January 13, 2022 Share Posted January 13, 2022 That's exactly what I was looking for - thank you. I think in most cases having an actual date time is preferable for most people. 1 Link to comment Share on other sites More sharing options...
adrian Posted January 19, 2022 Share Posted January 19, 2022 Hi Robin, It's only a minor thing, but I just noticed this when clicking the show when using InputfieldSelector. Note the position of the calendar icon on top of the page numbers. matches 1716 pages (show) 1 Link to comment Share on other sites More sharing options...
Robin S Posted January 19, 2022 Author Share Posted January 19, 2022 3 hours ago, adrian said: Note the position of the calendar icon on top of the page numbers. Thanks, should be fixed in v0.1.2. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now