mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-06 15:41:48 +01:00
🐛 Improve database date field (#15772)
fix https://github.com/siyuan-note/siyuan/issues/13252 , https://github.com/siyuan-note/siyuan/issues/15747
This commit is contained in:
parent
45a6a190d0
commit
52a4815419
1 changed files with 5 additions and 3 deletions
|
|
@ -18,9 +18,9 @@ export const getDateHTML = (cellElements: HTMLElement[]) => {
|
|||
let value2 = "";
|
||||
if (cellValue.isNotEmpty2) {
|
||||
value2 = dayjs(cellValue.content2).format(isNotTime ? "YYYY-MM-DD" : "YYYY-MM-DD HH:mm");
|
||||
const year = value.split("-")[0];
|
||||
if (year.length !== 4) {
|
||||
value = new Array(4 - year.length).fill(0).join("") + value;
|
||||
const year2 = value2.split("-")[0];
|
||||
if (year2.length !== 4) {
|
||||
value2 = new Array(4 - year2.length).fill(0).join("") + value;
|
||||
}
|
||||
} else if (cellValue.hasEndDate) {
|
||||
value2 = dayjs(currentDate).format(isNotTime ? "YYYY-MM-DD" : "YYYY-MM-DD HH:mm");
|
||||
|
|
@ -94,6 +94,8 @@ export const bindDateEvent = (options: {
|
|||
}
|
||||
});
|
||||
inputElements[3].addEventListener("change", () => {
|
||||
inputElements[0].value = "";
|
||||
inputElements[1].value = "";
|
||||
if (inputElements[3].checked) {
|
||||
inputElements[0].setAttribute("type", "datetime-local");
|
||||
inputElements[1].setAttribute("type", "datetime-local");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue