此插件在中国使用日期不是很理想,于是决定修改代码
下面是插件信息:
User Statistics
A Flarum extension. Add some user statistics in flarum posts, this extension require clarkwinkelmann/flarum-ext-likes-received
and will be installed automatically.
Usage
Remember to set the permission to "All" for clarkwinkelmann/flarum-ext-likes-received to make it works for guests.
Installation
Install with composer:
composer require justoverclock/user-statistics:"*"
Updating
composer update justoverclock/user-statistics:"*"
php flarum cache:clear
安装教程就不介绍了。进入安装目录,
index/vendor/justoverclock/user-statistics/js/dist
找到 forum.js
javascript
var a=e.joinTime().toString().split(" ").slice(1,4).join(" "),
替换成
javascript
var joinTime = e.joinTime();var date = new Date(joinTime);var year = date.getFullYear();var month = ("0" + (date.getMonth() + 1)).slice(-2);var day = ("0" + date.getDate()).slice(-2);var formattedDate = year + "-" + month + "-" + day;var a = formattedDate,
然后在跟目录执行
javascript
php flarum cache:clear
然后前端界面就变成了。
完工。