dce-reactkit 3.2.2-beta.13 → 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 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
- const firstDay = (month === today.month
1369
- ? today.day // Current month: start at current date
1370
- : 1 // Future month: start at beginning of month
1371
- );
1372
- for (let day = firstDay; day <= numDaysInMonth; day++) {
1373
- days.push(day);
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}`,
@@ -3016,19 +3029,15 @@ const LogReviewer = (props) => {
3016
3029
  if (expandedFilterDrawer === FilterDrawer.Date) {
3017
3030
  filterDrawer = (React__default["default"].createElement(TabBox, { title: "Date" },
3018
3031
  React__default["default"].createElement(SimpleDateChooser, { ariaLabel: "filter start date", name: "filter-start-date", year: dateFilterState.startDate.year, month: dateFilterState.startDate.month, day: dateFilterState.startDate.day, chooseFromPast: true, onChange: (month, day, year) => {
3019
- dispatch({
3020
- type: ActionType.UpdateDateFilterState,
3021
- dateFilterState: Object.assign(Object.assign({}, dateFilterState), { startDate: { month, day, year } }),
3022
- });
3032
+ dateFilterState.startDate = { month, day, year };
3033
+ handleDateRangeUpdated(dateFilterState);
3023
3034
  } }),
3024
3035
  ' ',
3025
3036
  "to",
3026
3037
  ' ',
3027
3038
  React__default["default"].createElement(SimpleDateChooser, { ariaLabel: "filter end date", name: "filter-end-date", year: dateFilterState.endDate.year, month: dateFilterState.endDate.month, day: dateFilterState.endDate.day, chooseFromPast: true, onChange: (month, day, year) => {
3028
- dispatch({
3029
- type: ActionType.UpdateDateFilterState,
3030
- dateFilterState: Object.assign(Object.assign({}, dateFilterState), { endDate: { month, day, year } }),
3031
- });
3039
+ dateFilterState.endDate = { month, day, year };
3040
+ handleDateRangeUpdated(dateFilterState);
3032
3041
  } })));
3033
3042
  }
3034
3043
  else if (expandedFilterDrawer === FilterDrawer.Context) {