IO-1066 IO-1073 Minor UI fixes.

This commit is contained in:
Patrick Fic
2021-05-10 16:51:33 -07:00
parent b8e5034a67
commit 15bf129b6e
9 changed files with 70 additions and 29 deletions

View File

@@ -5,7 +5,10 @@ import React, { forwardRef } from "react";
const dateFormat = "MM/DD/YYYY";
const FormDatePicker = ({ value, onChange, onBlur, ...restProps }, ref) => {
const FormDatePicker = (
{ value, onChange, onBlur, onlyFuture, ...restProps },
ref
) => {
const handleChange = (newDate) => {
if (value !== newDate && onChange) {
onChange(newDate);
@@ -28,6 +31,9 @@ const FormDatePicker = ({ value, onChange, onBlur, ...restProps }, ref) => {
format={dateFormat}
onBlur={onBlur}
disabledTime
{...(onlyFuture && {
disabledDate: (d) => moment().subtract(1, "day").isAfter(d),
})}
{...restProps}
/>
</div>