Added Statistics calculation
Statistics now show calculated values
This commit is contained in:
parent
fe87374e47
commit
fc0f69dacb
2147 changed files with 141321 additions and 39 deletions
61
node_modules/@mui/x-date-pickers/validation/validateDate.js
generated
vendored
Normal file
61
node_modules/@mui/x-date-pickers/validation/validateDate.js
generated
vendored
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.validateDate = void 0;
|
||||
var _valueManagers = require("../internals/utils/valueManagers");
|
||||
/**
|
||||
* Validation props used by the Date Picker, Date Field and Date Calendar components.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Validation props as received by the validateDate method.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Name of the props that should be defaulted before being passed to the validateDate method.
|
||||
*/
|
||||
|
||||
const validateDate = ({
|
||||
props,
|
||||
value,
|
||||
timezone,
|
||||
adapter
|
||||
}) => {
|
||||
if (value === null) {
|
||||
return null;
|
||||
}
|
||||
const {
|
||||
shouldDisableDate,
|
||||
shouldDisableMonth,
|
||||
shouldDisableYear,
|
||||
disablePast,
|
||||
disableFuture,
|
||||
minDate,
|
||||
maxDate
|
||||
} = props;
|
||||
const now = adapter.date(undefined, timezone);
|
||||
switch (true) {
|
||||
case !adapter.isValid(value):
|
||||
return 'invalidDate';
|
||||
case Boolean(shouldDisableDate && shouldDisableDate(value)):
|
||||
return 'shouldDisableDate';
|
||||
case Boolean(shouldDisableMonth && shouldDisableMonth(value)):
|
||||
return 'shouldDisableMonth';
|
||||
case Boolean(shouldDisableYear && shouldDisableYear(value)):
|
||||
return 'shouldDisableYear';
|
||||
case Boolean(disableFuture && adapter.isAfterDay(value, now)):
|
||||
return 'disableFuture';
|
||||
case Boolean(disablePast && adapter.isBeforeDay(value, now)):
|
||||
return 'disablePast';
|
||||
case Boolean(minDate && adapter.isBeforeDay(value, minDate)):
|
||||
return 'minDate';
|
||||
case Boolean(maxDate && adapter.isAfterDay(value, maxDate)):
|
||||
return 'maxDate';
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
};
|
||||
exports.validateDate = validateDate;
|
||||
validateDate.valueManager = _valueManagers.singleItemValueManager;
|
||||
Loading…
Add table
Add a link
Reference in a new issue