@raketa-cloud/admin 1.8.20 → 1.8.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -67,12 +67,29 @@
|
|
|
67
67
|
const dueDateWrapper = document.getElementById("due_date_wrapper");
|
|
68
68
|
const dueDateInput = document.getElementById("due_date");
|
|
69
69
|
|
|
70
|
+
function getTwoDaysFromNowString() {
|
|
71
|
+
const date = new Date();
|
|
72
|
+
date.setDate(date.getDate() + 2);
|
|
73
|
+
const year = date.getFullYear();
|
|
74
|
+
const month = String(date.getMonth() + 1).padStart(2, "0");
|
|
75
|
+
const day = String(date.getDate()).padStart(2, "0");
|
|
76
|
+
const hours = String(date.getHours()).padStart(2, "0");
|
|
77
|
+
const minutes = String(date.getMinutes()).padStart(2, "0");
|
|
78
|
+
return `${year}-${month}-${day}T${hours}:${minutes}`;
|
|
79
|
+
}
|
|
80
|
+
|
|
70
81
|
function toggleDueDate() {
|
|
71
82
|
if (!workflowSelect || !dueDateWrapper || !dueDateInput) return;
|
|
83
|
+
const minDate = getTwoDaysFromNowString();
|
|
84
|
+
dueDateInput.min = minDate;
|
|
85
|
+
|
|
72
86
|
const isDefault = !workflowSelect.value;
|
|
73
87
|
dueDateWrapper.style.display = isDefault ? "none" : "block";
|
|
88
|
+
|
|
74
89
|
if (isDefault) {
|
|
75
90
|
dueDateInput.value = "";
|
|
91
|
+
} else if (!dueDateInput.value) {
|
|
92
|
+
dueDateInput.value = minDate;
|
|
76
93
|
}
|
|
77
94
|
}
|
|
78
95
|
|