Skip to content

Commit

Permalink
Code review: Lukas
Browse files Browse the repository at this point in the history
  • Loading branch information
flaviendelangle committed Jan 26, 2024
1 parent 478c815 commit 68e9d73
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 143 deletions.
8 changes: 1 addition & 7 deletions docs/pages/x/api/date-pickers/date-range-picker-day.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
{
"props": {
"day": {
"type": {
"name": "union",
"description": "Date<br>&#124;&nbsp;object<br>&#124;&nbsp;{ add: func, clone: func, date: func, day: func, daysInMonth: func, diff: func, endOf: func, format: func, get: func, hour: func, isAfter: func, isBefore: func, isBetween: func, isSame: func, isUTC: func, isValid: func, local: func, locale: func, millisecond: func, minute: func, month: func, offsetName: func, second: func, set: func, startOf: func, subtract: func, toDate: func, toISOString: func, toJSON: func, toString: func, tz: func, unix: func, utc: func, utcOffset: func, valueOf: func, week: func, year: func }"
},
"required": true
},
"day": { "type": { "name": "object" }, "required": true },
"isEndOfHighlighting": { "type": { "name": "bool" }, "required": true },
"isEndOfPreviewing": { "type": { "name": "bool" }, "required": true },
"isFirstVisibleCell": { "type": { "name": "bool" }, "required": true },
Expand Down
8 changes: 1 addition & 7 deletions docs/pages/x/api/date-pickers/pickers-day.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
{
"props": {
"day": {
"type": {
"name": "union",
"description": "Date<br>&#124;&nbsp;object<br>&#124;&nbsp;{ add: func, clone: func, date: func, day: func, daysInMonth: func, diff: func, endOf: func, format: func, get: func, hour: func, isAfter: func, isBefore: func, isBetween: func, isSame: func, isUTC: func, isValid: func, local: func, locale: func, millisecond: func, minute: func, month: func, offsetName: func, second: func, set: func, startOf: func, subtract: func, toDate: func, toISOString: func, toJSON: func, toString: func, tz: func, unix: func, utc: func, utcOffset: func, valueOf: func, week: func, year: func }"
},
"required": true
},
"day": { "type": { "name": "object" }, "required": true },
"isFirstVisibleCell": { "type": { "name": "bool" }, "required": true },
"isLastVisibleCell": { "type": { "name": "bool" }, "required": true },
"outsideCurrentMonth": { "type": { "name": "bool" }, "required": true },
Expand Down
2 changes: 2 additions & 0 deletions docs/scripts/generateProptypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ async function generateProptypes(project: XTypeScriptProject, sourceFile: string
'minTime',
'maxTime',
'referenceDate',
'day',
'currentMonth',
];

if (T_DATE_PROPS.includes(name)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,49 +376,7 @@ DateRangePickerDayRaw.propTypes = {
/**
* The date to show.
*/
day: PropTypes.oneOfType([
PropTypes.instanceOf(Date),
PropTypes.object,
PropTypes.shape({
add: PropTypes.func.isRequired,
clone: PropTypes.func.isRequired,
date: PropTypes.func.isRequired,
day: PropTypes.func.isRequired,
daysInMonth: PropTypes.func.isRequired,
diff: PropTypes.func.isRequired,
endOf: PropTypes.func.isRequired,
format: PropTypes.func.isRequired,
get: PropTypes.func.isRequired,
hour: PropTypes.func.isRequired,
isAfter: PropTypes.func.isRequired,
isBefore: PropTypes.func.isRequired,
isBetween: PropTypes.func.isRequired,
isSame: PropTypes.func.isRequired,
isUTC: PropTypes.func.isRequired,
isValid: PropTypes.func.isRequired,
local: PropTypes.func.isRequired,
locale: PropTypes.func.isRequired,
millisecond: PropTypes.func.isRequired,
minute: PropTypes.func.isRequired,
month: PropTypes.func.isRequired,
offsetName: PropTypes.func.isRequired,
second: PropTypes.func.isRequired,
set: PropTypes.func.isRequired,
startOf: PropTypes.func.isRequired,
subtract: PropTypes.func.isRequired,
toDate: PropTypes.func.isRequired,
toISOString: PropTypes.func.isRequired,
toJSON: PropTypes.func.isRequired,
toString: PropTypes.func.isRequired,
tz: PropTypes.func.isRequired,
unix: PropTypes.func.isRequired,
utc: PropTypes.func.isRequired,
utcOffset: PropTypes.func.isRequired,
valueOf: PropTypes.func.isRequired,
week: PropTypes.func.isRequired,
year: PropTypes.func.isRequired,
}),
]).isRequired,
day: PropTypes.object.isRequired,
/**
* If `true`, renders as disabled.
* @default false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,49 +267,7 @@ PickersCalendarHeader.propTypes = {
*/
classes: PropTypes.object,
className: PropTypes.string,
currentMonth: PropTypes.oneOfType([
PropTypes.instanceOf(Date),
PropTypes.object,
PropTypes.shape({
add: PropTypes.func.isRequired,
clone: PropTypes.func.isRequired,
date: PropTypes.func.isRequired,
day: PropTypes.func.isRequired,
daysInMonth: PropTypes.func.isRequired,
diff: PropTypes.func.isRequired,
endOf: PropTypes.func.isRequired,
format: PropTypes.func.isRequired,
get: PropTypes.func.isRequired,
hour: PropTypes.func.isRequired,
isAfter: PropTypes.func.isRequired,
isBefore: PropTypes.func.isRequired,
isBetween: PropTypes.func.isRequired,
isSame: PropTypes.func.isRequired,
isUTC: PropTypes.func.isRequired,
isValid: PropTypes.func.isRequired,
local: PropTypes.func.isRequired,
locale: PropTypes.func.isRequired,
millisecond: PropTypes.func.isRequired,
minute: PropTypes.func.isRequired,
month: PropTypes.func.isRequired,
offsetName: PropTypes.func.isRequired,
second: PropTypes.func.isRequired,
set: PropTypes.func.isRequired,
startOf: PropTypes.func.isRequired,
subtract: PropTypes.func.isRequired,
toDate: PropTypes.func.isRequired,
toISOString: PropTypes.func.isRequired,
toJSON: PropTypes.func.isRequired,
toString: PropTypes.func.isRequired,
tz: PropTypes.func.isRequired,
unix: PropTypes.func.isRequired,
utc: PropTypes.func.isRequired,
utcOffset: PropTypes.func.isRequired,
valueOf: PropTypes.func.isRequired,
week: PropTypes.func.isRequired,
year: PropTypes.func.isRequired,
}),
]).isRequired,
currentMonth: PropTypes.object.isRequired,
disabled: PropTypes.bool,
disableFuture: PropTypes.bool,
disablePast: PropTypes.bool,
Expand Down
44 changes: 1 addition & 43 deletions packages/x-date-pickers/src/PickersDay/PickersDay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -374,49 +374,7 @@ PickersDayRaw.propTypes = {
/**
* The date to show.
*/
day: PropTypes.oneOfType([
PropTypes.instanceOf(Date),
PropTypes.object,
PropTypes.shape({
add: PropTypes.func.isRequired,
clone: PropTypes.func.isRequired,
date: PropTypes.func.isRequired,
day: PropTypes.func.isRequired,
daysInMonth: PropTypes.func.isRequired,
diff: PropTypes.func.isRequired,
endOf: PropTypes.func.isRequired,
format: PropTypes.func.isRequired,
get: PropTypes.func.isRequired,
hour: PropTypes.func.isRequired,
isAfter: PropTypes.func.isRequired,
isBefore: PropTypes.func.isRequired,
isBetween: PropTypes.func.isRequired,
isSame: PropTypes.func.isRequired,
isUTC: PropTypes.func.isRequired,
isValid: PropTypes.func.isRequired,
local: PropTypes.func.isRequired,
locale: PropTypes.func.isRequired,
millisecond: PropTypes.func.isRequired,
minute: PropTypes.func.isRequired,
month: PropTypes.func.isRequired,
offsetName: PropTypes.func.isRequired,
second: PropTypes.func.isRequired,
set: PropTypes.func.isRequired,
startOf: PropTypes.func.isRequired,
subtract: PropTypes.func.isRequired,
toDate: PropTypes.func.isRequired,
toISOString: PropTypes.func.isRequired,
toJSON: PropTypes.func.isRequired,
toString: PropTypes.func.isRequired,
tz: PropTypes.func.isRequired,
unix: PropTypes.func.isRequired,
utc: PropTypes.func.isRequired,
utcOffset: PropTypes.func.isRequired,
valueOf: PropTypes.func.isRequired,
week: PropTypes.func.isRequired,
year: PropTypes.func.isRequired,
}),
]).isRequired,
day: PropTypes.object.isRequired,
/**
* If `true`, renders as disabled.
* @default false
Expand Down

0 comments on commit 68e9d73

Please sign in to comment.