nodebb-plugin-equipment-calendar 8.9.1 → 8.9.2
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 +1 -1
- package/plugin.json +1 -1
- package/public/js/client.js +11 -24
package/package.json
CHANGED
package/plugin.json
CHANGED
package/public/js/client.js
CHANGED
|
@@ -143,49 +143,36 @@ function updateTotalPrice() {
|
|
|
143
143
|
eventContent: function(arg) {
|
|
144
144
|
try {
|
|
145
145
|
var status = (arg.event.extendedProps && arg.event.extendedProps.status) ? arg.event.extendedProps.status : '';
|
|
146
|
-
var iconTxt = '';
|
|
147
146
|
var iconClass = '';
|
|
148
|
-
if (status === 'pending')
|
|
149
|
-
else if (status === 'paid')
|
|
150
|
-
else if (status === 'approved')
|
|
151
|
-
else if (status === 'rejected' || status === 'cancelled')
|
|
147
|
+
if (status === 'pending') iconClass = 'fa fa-hourglass-half text-warning';
|
|
148
|
+
else if (status === 'paid') iconClass = 'fa fa-check-circle text-success';
|
|
149
|
+
else if (status === 'approved') iconClass = 'fa fa-check text-success';
|
|
150
|
+
else if (status === 'rejected' || status === 'cancelled') iconClass = 'fa fa-times text-danger';
|
|
152
151
|
|
|
153
152
|
var wrap = document.createElement('div');
|
|
154
153
|
wrap.className = 'ec-event';
|
|
155
|
-
var icon = document.createElement('span');
|
|
156
|
-
icon.className = 'ec-icon';
|
|
157
|
-
// Prefer fontawesome if available, but keep emoji fallback
|
|
158
154
|
if (iconClass) {
|
|
159
|
-
icon
|
|
160
|
-
|
|
161
|
-
icon.
|
|
155
|
+
var icon = document.createElement('span');
|
|
156
|
+
icon.className = 'ec-icon';
|
|
157
|
+
icon.innerHTML = '<i class="' + iconClass + '"></i>';
|
|
158
|
+
wrap.appendChild(icon);
|
|
162
159
|
}
|
|
163
160
|
var t = document.createElement('span');
|
|
164
161
|
t.className = 'ec-title';
|
|
165
162
|
t.textContent = arg.event.title || '';
|
|
166
|
-
if (iconTxt && (!iconClass || !document.querySelector('link[href*="fontawesome"], style, script'))) {
|
|
167
|
-
// emoji fallback shown if needed
|
|
168
|
-
var em = document.createElement('span');
|
|
169
|
-
em.textContent = iconTxt + ' ';
|
|
170
|
-
wrap.appendChild(em);
|
|
171
|
-
} else if (iconClass) {
|
|
172
|
-
wrap.appendChild(icon);
|
|
173
|
-
}
|
|
174
163
|
wrap.appendChild(t);
|
|
175
164
|
return { domNodes: [wrap] };
|
|
176
165
|
} catch (e) {
|
|
177
166
|
return true;
|
|
178
167
|
}
|
|
179
|
-
} catch (e) {
|
|
180
|
-
return true;
|
|
181
|
-
}
|
|
182
168
|
},
|
|
183
169
|
timeZone: 'local',
|
|
184
170
|
events: events,
|
|
185
171
|
select: function (info) {
|
|
186
172
|
if (!window.EC_CAN_CREATE) return;
|
|
187
|
-
const startIso = info.startStr; // YYYY-MM-DD
|
|
188
|
-
const
|
|
173
|
+
const startIso = String(info.startStr || '').slice(0,10); // YYYY-MM-DD
|
|
174
|
+
const endEnd = String(info.endStr || '').slice(0,10);
|
|
175
|
+
const endIsoInclusive = addDaysIsoLocal(endEnd, -1); // endStr is exclusive
|
|
189
176
|
openCreateModal(startIso, endIsoInclusive);
|
|
190
177
|
},
|
|
191
178
|
dateClick: function (info) {
|