@awsui/components-react
Version:
AWS UI is a collection of [React](https://reactjs.org/) components that help create intuitive, responsive, and accessible user experiences for web applications. It is developed by Amazon Web Services (AWS). This work is available under the terms of the [A
16 lines (15 loc) • 466 B
JavaScript
import { differenceInMonths } from 'date-fns';
var moveFocusHandler = function (focussed, isDateEnabled, moveCallback) {
var current = moveCallback(focussed);
if (!isDateEnabled) {
return current;
}
while (!isDateEnabled(current)) {
if (Math.abs(differenceInMonths(focussed, current)) > 1) {
return focussed;
}
current = moveCallback(current);
}
return current;
};
export default moveFocusHandler;