modifiedcontent Posted January 17, 2023 Share Posted January 17, 2023 Very minor wishlist request/question: When I go to /access/users I always have to manually add the column with Created or Modified to be able to sort by date and get the latest activity. I would like to have that as the default; get the latest users access data and not with 'two months ago' but actual dates. Or is there a way to configure that? Link to comment Share on other sites More sharing options...
BitPoet Posted January 17, 2023 Share Posted January 17, 2023 It's not configurable, since the module config doesn't show system fields, but you can add them permanently with this little snipped for site/ready.php: <?php namespace ProcessWire; wire()->addHookBefore('ProcessUser::execute', function(HookEvent $event) { $process = $event->object; $process->showFields = array_merge($process->showFields, ["created", "modified"]); }); For changing the date format to something more precise, you can hook into the lister: <?php namespace ProcessWire; wire()->addHookBefore('ProcessPageLister::execute', function(HookEvent $event) { $page = wire('page'); // Only continue if we're actually listing users in the backend if($page->process !== 'ProcessUser') return; $lister = $event->object; // Assign whatever date format you like $lister->nativeDateFormat = 'Y-m-d H:i'; }); 2 Link to comment Share on other sites More sharing options...
teppo Posted January 17, 2023 Share Posted January 17, 2023 https://processwire.com/modules/lister-native-date-format/ is great for formatting lister dates, by the way. You can configure preferred default format for native date fields and switch format on the fly ? 5 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