dce-reactkit 3.2.2-beta.14 → 3.2.2-beta.15
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/cjs/index.js +19 -6
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +19 -6
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/SimpleDateChooser.tsx +20 -7
package/dist/cjs/index.js
CHANGED
|
@@ -1365,12 +1365,25 @@ const SimpleDateChooser = (props) => {
|
|
|
1365
1365
|
// Figure out which days are allowed
|
|
1366
1366
|
const days = [];
|
|
1367
1367
|
const numDaysInMonth = (new Date(year, month, 0)).getDate();
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1368
|
+
if (chooseFromPast) {
|
|
1369
|
+
// Past selection
|
|
1370
|
+
const numDaysToAdd = ((month === today.month)
|
|
1371
|
+
? today.day // Current month, only add up to today
|
|
1372
|
+
: numDaysInMonth // Past month, add all days
|
|
1373
|
+
);
|
|
1374
|
+
for (let day = 1; day <= numDaysToAdd; day++) {
|
|
1375
|
+
days.push(day);
|
|
1376
|
+
}
|
|
1377
|
+
}
|
|
1378
|
+
else {
|
|
1379
|
+
// Future selection: add all remaining days of the month
|
|
1380
|
+
const firstDay = (month === today.month
|
|
1381
|
+
? today.day // Current month: start at current date
|
|
1382
|
+
: 1 // Future month: start at beginning of month
|
|
1383
|
+
);
|
|
1384
|
+
for (let day = firstDay; day <= numDaysInMonth; day++) {
|
|
1385
|
+
days.push(day);
|
|
1386
|
+
}
|
|
1374
1387
|
}
|
|
1375
1388
|
choices.push({
|
|
1376
1389
|
choiceName: `${monthName} ${year}`,
|