mirror of
https://github.com/kuaifan/dootask.git
synced 2026-02-28 04:40:37 +00:00
perf: 7天内显示时间m-d H:i
This commit is contained in:
parent
b749426389
commit
d0d6b8ce97
7
resources/assets/js/functions/web.js
vendored
7
resources/assets/js/functions/web.js
vendored
@ -103,10 +103,13 @@
|
||||
*/
|
||||
formatTime(date) {
|
||||
let time = $A.Date(date, true),
|
||||
now = $A.Time(),
|
||||
string = '';
|
||||
if ($A.formatDate('Ymd') === $A.formatDate('Ymd', time)) {
|
||||
if ($A.formatDate('Ymd', now) === $A.formatDate('Ymd', time)) {
|
||||
string = $A.formatDate('H:i', time)
|
||||
} else if ($A.formatDate('Y') === $A.formatDate('Y', time)) {
|
||||
} else if (now - time < 86400 * 7) {
|
||||
string = $A.formatDate('m-d H:i', time)
|
||||
} else if ($A.formatDate('Y', now) === $A.formatDate('Y', time)) {
|
||||
string = $A.formatDate('m-d', time)
|
||||
} else {
|
||||
string = $A.formatDate('Y-m-d', time)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user