-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
acda97c
commit 714c2a6
Showing
7 changed files
with
105 additions
and
4,155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import CustomTextField from "src/@core/components/mui/text-field"; | ||
|
||
interface InputCustomProps { | ||
fullWidth?: boolean; | ||
label: string; | ||
name: string; | ||
id: string; | ||
value: any; | ||
onChange?: (id: string, newValue?: any) => void; | ||
onBlur?: React.FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>; | ||
helperText?: any; | ||
error?: boolean; | ||
required?: boolean; | ||
} | ||
|
||
export function InputDate(props: InputCustomProps) { | ||
|
||
return ( | ||
<CustomTextField | ||
fullWidth={props.fullWidth} | ||
label={props.label} | ||
name={props.name} | ||
id={props.id} | ||
value={props.value} | ||
onBlur={props.onBlur} | ||
onChange={(e) => { | ||
if (props.onChange) { | ||
props.onChange(props.id, e.target.value) | ||
} | ||
}} | ||
helperText={props.helperText} | ||
error={props.error} | ||
required={props.required} | ||
type="date" | ||
/> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
export function convertDate(date?: string): string | undefined { | ||
if (!date) { | ||
return undefined; | ||
} | ||
const newDateSplit = date.split("-"); | ||
if (newDateSplit.length !== 3) { | ||
return date; | ||
} | ||
return `${newDateSplit[0]}-${newDateSplit[2]}-${newDateSplit[1]}`; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.