[Frontend][全域功能] displayDate Function 更新
This commit is contained in:
parent
a920c364f5
commit
6565685b5c
@ -288,20 +288,20 @@ function displayDate(dateTime, dateType = "YMdHms", locale = 'zh-TW') {
|
||||
dateType.indexOf("S") != -1 ? millisecond = parseInt(d.getMilliseconds()) : "";
|
||||
} else if (dateType == "date") {
|
||||
year = d.getFullYear();
|
||||
month = String(d.getMonth() + 1).padStart(2, '0');
|
||||
day = String(d.getDate()).padStart(2, '0');
|
||||
month = d.getMonth() + 1;
|
||||
day = d.getDate();
|
||||
} else if (dateType == "time") {
|
||||
hour = String(d.getHours()).padStart(2, '0');
|
||||
minute = String(d.getMinutes()).padStart(2, '0');
|
||||
hour = d.getHours();
|
||||
minute = d.getMinutes();
|
||||
} else if (dateType == "datetime") {
|
||||
year = d.getFullYear();
|
||||
month = String(d.getMonth() + 1).padStart(2, '0');
|
||||
day = String(d.getDate()).padStart(2, '0');
|
||||
hour = String(d.getHours()).padStart(2, '0');
|
||||
minute = String(d.getMinutes()).padStart(2, '0');
|
||||
month = d.getMonth() + 1;
|
||||
day = d.getDate();
|
||||
hour = d.getHours();
|
||||
minute = d.getMinutes();
|
||||
}
|
||||
date = [year, month, day].filter(n => n).join("/");
|
||||
time = [hour, minute, second, millisecond].filter(n => n).join(":");
|
||||
date = [year, String(month).padStart(2, '0'), String(day).padStart(2, '0')].filter(n => n).join("/");
|
||||
time = [String(hour).padStart(2, '0'), String(minute).padStart(2, '0')].filter(n => n).join(":");
|
||||
result = date.toString() + " " + time.toString();
|
||||
|
||||
if (dateType == "date") {
|
||||
|
Loading…
Reference in New Issue
Block a user