mirror of
https://github.com/kuaifan/dootask.git
synced 2026-03-17 19:23:26 +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) {
|
formatTime(date) {
|
||||||
let time = $A.Date(date, true),
|
let time = $A.Date(date, true),
|
||||||
|
now = $A.Time(),
|
||||||
string = '';
|
string = '';
|
||||||
if ($A.formatDate('Ymd') === $A.formatDate('Ymd', time)) {
|
if ($A.formatDate('Ymd', now) === $A.formatDate('Ymd', time)) {
|
||||||
string = $A.formatDate('H:i', 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)
|
string = $A.formatDate('m-d', time)
|
||||||
} else {
|
} else {
|
||||||
string = $A.formatDate('Y-m-d', time)
|
string = $A.formatDate('Y-m-d', time)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user