akfatimeline 2.2.3 → 2.2.4
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/dist/Timeline.js
CHANGED
|
@@ -4152,18 +4152,41 @@ const TimelineContent = _ref => {
|
|
|
4152
4152
|
}
|
|
4153
4153
|
}
|
|
4154
4154
|
|
|
4155
|
-
// Eğer disableDates mode: 'include' ise
|
|
4155
|
+
// Eğer disableDates mode: 'include' ise, tıklanan tarihin range'ini veya date'ini bul
|
|
4156
4156
|
let startDate = clickedDate;
|
|
4157
4157
|
let endDate = new Date(clickedDate.getTime() + 24 * 60 * 60 * 1000); // Varsayılan: 1 gün
|
|
4158
4158
|
let enabledRange = null;
|
|
4159
|
-
if (disableDates && disableDates.mode === 'include'
|
|
4160
|
-
|
|
4161
|
-
if (
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
|
|
4166
|
-
|
|
4159
|
+
if (disableDates && disableDates.mode === 'include') {
|
|
4160
|
+
// Önce ranges'te ara
|
|
4161
|
+
if (disableDates.ranges && disableDates.ranges.length > 0) {
|
|
4162
|
+
enabledRange = findEnabledRangeForDate(clickedDate, disableDates);
|
|
4163
|
+
if (enabledRange) {
|
|
4164
|
+
// Range bulundu, range'in tamamını seç
|
|
4165
|
+
startDate = enabledRange.start;
|
|
4166
|
+
// endDate'i direkt range'in end'i olarak kullan
|
|
4167
|
+
// Range'in end'i zaten son günü temsil ediyor (inclusive)
|
|
4168
|
+
endDate = enabledRange.end;
|
|
4169
|
+
}
|
|
4170
|
+
}
|
|
4171
|
+
|
|
4172
|
+
// Eğer range bulunamadıysa, dates array'inde tek tek tarih var mı kontrol et
|
|
4173
|
+
if (!enabledRange && disableDates.dates && disableDates.dates.length > 0) {
|
|
4174
|
+
const clickedDateOnly = new Date(clickedDate.getFullYear(), clickedDate.getMonth(), clickedDate.getDate());
|
|
4175
|
+
const foundDate = disableDates.dates.find(d => {
|
|
4176
|
+
const dObj = parseDate(d);
|
|
4177
|
+
const dOnly = new Date(dObj.getFullYear(), dObj.getMonth(), dObj.getDate());
|
|
4178
|
+
return dOnly.getTime() === clickedDateOnly.getTime();
|
|
4179
|
+
});
|
|
4180
|
+
if (foundDate) {
|
|
4181
|
+
// Tek bir tarih bulundu, o tarihi seç (1 günlük event)
|
|
4182
|
+
const foundDateObj = parseDate(foundDate);
|
|
4183
|
+
startDate = new Date(foundDateObj.getFullYear(), foundDateObj.getMonth(), foundDateObj.getDate());
|
|
4184
|
+
endDate = new Date(startDate.getTime() + 24 * 60 * 60 * 1000); // 1 gün sonrası
|
|
4185
|
+
enabledRange = {
|
|
4186
|
+
start: startDate,
|
|
4187
|
+
end: startDate
|
|
4188
|
+
}; // Tek gün için range oluştur
|
|
4189
|
+
}
|
|
4167
4190
|
}
|
|
4168
4191
|
}
|
|
4169
4192
|
|
|
@@ -221,19 +221,40 @@ const TimelineContent = ({
|
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
223
|
|
|
224
|
-
// Eğer disableDates mode: 'include' ise
|
|
224
|
+
// Eğer disableDates mode: 'include' ise, tıklanan tarihin range'ini veya date'ini bul
|
|
225
225
|
let startDate = clickedDate;
|
|
226
226
|
let endDate = new Date(clickedDate.getTime() + 24 * 60 * 60 * 1000); // Varsayılan: 1 gün
|
|
227
227
|
let enabledRange = null;
|
|
228
228
|
|
|
229
|
-
if (disableDates && disableDates.mode === 'include'
|
|
230
|
-
|
|
231
|
-
if (
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
229
|
+
if (disableDates && disableDates.mode === 'include') {
|
|
230
|
+
// Önce ranges'te ara
|
|
231
|
+
if (disableDates.ranges && disableDates.ranges.length > 0) {
|
|
232
|
+
enabledRange = findEnabledRangeForDate(clickedDate, disableDates);
|
|
233
|
+
if (enabledRange) {
|
|
234
|
+
// Range bulundu, range'in tamamını seç
|
|
235
|
+
startDate = enabledRange.start;
|
|
236
|
+
// endDate'i direkt range'in end'i olarak kullan
|
|
237
|
+
// Range'in end'i zaten son günü temsil ediyor (inclusive)
|
|
238
|
+
endDate = enabledRange.end;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// Eğer range bulunamadıysa, dates array'inde tek tek tarih var mı kontrol et
|
|
243
|
+
if (!enabledRange && disableDates.dates && disableDates.dates.length > 0) {
|
|
244
|
+
const clickedDateOnly = new Date(clickedDate.getFullYear(), clickedDate.getMonth(), clickedDate.getDate());
|
|
245
|
+
const foundDate = disableDates.dates.find((d) => {
|
|
246
|
+
const dObj = parseDate(d);
|
|
247
|
+
const dOnly = new Date(dObj.getFullYear(), dObj.getMonth(), dObj.getDate());
|
|
248
|
+
return dOnly.getTime() === clickedDateOnly.getTime();
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
if (foundDate) {
|
|
252
|
+
// Tek bir tarih bulundu, o tarihi seç (1 günlük event)
|
|
253
|
+
const foundDateObj = parseDate(foundDate);
|
|
254
|
+
startDate = new Date(foundDateObj.getFullYear(), foundDateObj.getMonth(), foundDateObj.getDate());
|
|
255
|
+
endDate = new Date(startDate.getTime() + 24 * 60 * 60 * 1000); // 1 gün sonrası
|
|
256
|
+
enabledRange = { start: startDate, end: startDate }; // Tek gün için range oluştur
|
|
257
|
+
}
|
|
237
258
|
}
|
|
238
259
|
}
|
|
239
260
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "akfatimeline",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.4",
|
|
4
4
|
"description": "A customizable timeline component for React applications with disableDates, custom header buttons, and past date protection features",
|
|
5
5
|
"main": "./src/library.js",
|
|
6
6
|
"module": "./src/library.js",
|
|
@@ -221,19 +221,40 @@ const TimelineContent = ({
|
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
223
|
|
|
224
|
-
// Eğer disableDates mode: 'include' ise
|
|
224
|
+
// Eğer disableDates mode: 'include' ise, tıklanan tarihin range'ini veya date'ini bul
|
|
225
225
|
let startDate = clickedDate;
|
|
226
226
|
let endDate = new Date(clickedDate.getTime() + 24 * 60 * 60 * 1000); // Varsayılan: 1 gün
|
|
227
227
|
let enabledRange = null;
|
|
228
228
|
|
|
229
|
-
if (disableDates && disableDates.mode === 'include'
|
|
230
|
-
|
|
231
|
-
if (
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
229
|
+
if (disableDates && disableDates.mode === 'include') {
|
|
230
|
+
// Önce ranges'te ara
|
|
231
|
+
if (disableDates.ranges && disableDates.ranges.length > 0) {
|
|
232
|
+
enabledRange = findEnabledRangeForDate(clickedDate, disableDates);
|
|
233
|
+
if (enabledRange) {
|
|
234
|
+
// Range bulundu, range'in tamamını seç
|
|
235
|
+
startDate = enabledRange.start;
|
|
236
|
+
// endDate'i direkt range'in end'i olarak kullan
|
|
237
|
+
// Range'in end'i zaten son günü temsil ediyor (inclusive)
|
|
238
|
+
endDate = enabledRange.end;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// Eğer range bulunamadıysa, dates array'inde tek tek tarih var mı kontrol et
|
|
243
|
+
if (!enabledRange && disableDates.dates && disableDates.dates.length > 0) {
|
|
244
|
+
const clickedDateOnly = new Date(clickedDate.getFullYear(), clickedDate.getMonth(), clickedDate.getDate());
|
|
245
|
+
const foundDate = disableDates.dates.find((d) => {
|
|
246
|
+
const dObj = parseDate(d);
|
|
247
|
+
const dOnly = new Date(dObj.getFullYear(), dObj.getMonth(), dObj.getDate());
|
|
248
|
+
return dOnly.getTime() === clickedDateOnly.getTime();
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
if (foundDate) {
|
|
252
|
+
// Tek bir tarih bulundu, o tarihi seç (1 günlük event)
|
|
253
|
+
const foundDateObj = parseDate(foundDate);
|
|
254
|
+
startDate = new Date(foundDateObj.getFullYear(), foundDateObj.getMonth(), foundDateObj.getDate());
|
|
255
|
+
endDate = new Date(startDate.getTime() + 24 * 60 * 60 * 1000); // 1 gün sonrası
|
|
256
|
+
enabledRange = { start: startDate, end: startDate }; // Tek gün için range oluştur
|
|
257
|
+
}
|
|
237
258
|
}
|
|
238
259
|
}
|
|
239
260
|
|