mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-13 16:22:59 +10:00
fix(client): 🐛 fix mui rendering of utc dates
This commit is contained in:
@ -63,7 +63,7 @@ const ResumeInput: React.FC<Props> = ({ type = 'text', label, path, className, m
|
|||||||
renderInput={(params) => <TextField {...params} error={false} className={className} />}
|
renderInput={(params) => <TextField {...params} error={false} className={className} />}
|
||||||
onChange={(date: Date | null, keyboardInputValue: string | undefined) => {
|
onChange={(date: Date | null, keyboardInputValue: string | undefined) => {
|
||||||
isEmpty(keyboardInputValue) && onChangeValue('');
|
isEmpty(keyboardInputValue) && onChangeValue('');
|
||||||
date && dayjs(date).utc().isValid() && onChangeValue(date.toISOString());
|
date && dayjs(date).utc().isValid() && onChangeValue(dayjs(date).utc().toISOString());
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -134,7 +134,7 @@ const AwardModal: React.FC = () => {
|
|||||||
views={['year', 'month', 'day']}
|
views={['year', 'month', 'day']}
|
||||||
onChange={(date: Date | null, keyboardInputValue: string | undefined) => {
|
onChange={(date: Date | null, keyboardInputValue: string | undefined) => {
|
||||||
isEmpty(keyboardInputValue) && field.onChange('');
|
isEmpty(keyboardInputValue) && field.onChange('');
|
||||||
date && dayjs(date).utc().isValid() && field.onChange(date.toISOString());
|
date && dayjs(date).utc().isValid() && field.onChange(dayjs(date).utc().toISOString());
|
||||||
}}
|
}}
|
||||||
renderInput={(params) => (
|
renderInput={(params) => (
|
||||||
<TextField
|
<TextField
|
||||||
|
|||||||
@ -134,7 +134,7 @@ const CertificateModal: React.FC = () => {
|
|||||||
views={['year', 'month', 'day']}
|
views={['year', 'month', 'day']}
|
||||||
onChange={(date: Date | null, keyboardInputValue: string | undefined) => {
|
onChange={(date: Date | null, keyboardInputValue: string | undefined) => {
|
||||||
isEmpty(keyboardInputValue) && field.onChange('');
|
isEmpty(keyboardInputValue) && field.onChange('');
|
||||||
date && dayjs(date).utc().isValid() && field.onChange(date.toISOString());
|
date && dayjs(date).utc().isValid() && field.onChange(dayjs(date).utc().toISOString());
|
||||||
}}
|
}}
|
||||||
renderInput={(params) => (
|
renderInput={(params) => (
|
||||||
<TextField
|
<TextField
|
||||||
|
|||||||
@ -150,7 +150,7 @@ const CustomModal: React.FC = () => {
|
|||||||
views={['year', 'month', 'day']}
|
views={['year', 'month', 'day']}
|
||||||
onChange={(date: Date | null, keyboardInputValue: string | undefined) => {
|
onChange={(date: Date | null, keyboardInputValue: string | undefined) => {
|
||||||
isEmpty(keyboardInputValue) && field.onChange('');
|
isEmpty(keyboardInputValue) && field.onChange('');
|
||||||
date && dayjs(date).utc().isValid() && field.onChange(date.toISOString());
|
date && dayjs(date).utc().isValid() && field.onChange(dayjs(date).utc().toISOString());
|
||||||
}}
|
}}
|
||||||
renderInput={(params) => (
|
renderInput={(params) => (
|
||||||
<TextField
|
<TextField
|
||||||
@ -174,7 +174,7 @@ const CustomModal: React.FC = () => {
|
|||||||
views={['year', 'month', 'day']}
|
views={['year', 'month', 'day']}
|
||||||
onChange={(date: Date | null, keyboardInputValue: string | undefined) => {
|
onChange={(date: Date | null, keyboardInputValue: string | undefined) => {
|
||||||
isEmpty(keyboardInputValue) && field.onChange('');
|
isEmpty(keyboardInputValue) && field.onChange('');
|
||||||
date && dayjs(date).utc().isValid() && field.onChange(date.toISOString());
|
date && dayjs(date).utc().isValid() && field.onChange(dayjs(date).utc().toISOString());
|
||||||
}}
|
}}
|
||||||
renderInput={(params) => (
|
renderInput={(params) => (
|
||||||
<TextField
|
<TextField
|
||||||
|
|||||||
@ -173,7 +173,7 @@ const EducationModal: React.FC = () => {
|
|||||||
views={['year', 'month', 'day']}
|
views={['year', 'month', 'day']}
|
||||||
onChange={(date: Date | null, keyboardInputValue: string | undefined) => {
|
onChange={(date: Date | null, keyboardInputValue: string | undefined) => {
|
||||||
isEmpty(keyboardInputValue) && field.onChange('');
|
isEmpty(keyboardInputValue) && field.onChange('');
|
||||||
date && dayjs(date).utc().isValid() && field.onChange(date.toISOString());
|
date && dayjs(date).utc().isValid() && field.onChange(dayjs(date).utc().toISOString());
|
||||||
}}
|
}}
|
||||||
renderInput={(params) => (
|
renderInput={(params) => (
|
||||||
<TextField
|
<TextField
|
||||||
@ -197,7 +197,7 @@ const EducationModal: React.FC = () => {
|
|||||||
views={['year', 'month', 'day']}
|
views={['year', 'month', 'day']}
|
||||||
onChange={(date: Date | null, keyboardInputValue: string | undefined) => {
|
onChange={(date: Date | null, keyboardInputValue: string | undefined) => {
|
||||||
isEmpty(keyboardInputValue) && field.onChange('');
|
isEmpty(keyboardInputValue) && field.onChange('');
|
||||||
date && dayjs(date).utc().isValid() && field.onChange(date.toISOString());
|
date && dayjs(date).utc().isValid() && field.onChange(dayjs(date).utc().toISOString());
|
||||||
}}
|
}}
|
||||||
renderInput={(params) => (
|
renderInput={(params) => (
|
||||||
<TextField
|
<TextField
|
||||||
|
|||||||
@ -143,7 +143,7 @@ const ProjectModal: React.FC = () => {
|
|||||||
views={['year', 'month', 'day']}
|
views={['year', 'month', 'day']}
|
||||||
onChange={(date: Date | null, keyboardInputValue: string | undefined) => {
|
onChange={(date: Date | null, keyboardInputValue: string | undefined) => {
|
||||||
isEmpty(keyboardInputValue) && field.onChange('');
|
isEmpty(keyboardInputValue) && field.onChange('');
|
||||||
date && dayjs(date).utc().isValid() && field.onChange(date.toISOString());
|
date && dayjs(date).utc().isValid() && field.onChange(dayjs(date).utc().toISOString());
|
||||||
}}
|
}}
|
||||||
renderInput={(params) => (
|
renderInput={(params) => (
|
||||||
<TextField
|
<TextField
|
||||||
@ -167,7 +167,7 @@ const ProjectModal: React.FC = () => {
|
|||||||
views={['year', 'month', 'day']}
|
views={['year', 'month', 'day']}
|
||||||
onChange={(date: Date | null, keyboardInputValue: string | undefined) => {
|
onChange={(date: Date | null, keyboardInputValue: string | undefined) => {
|
||||||
isEmpty(keyboardInputValue) && field.onChange('');
|
isEmpty(keyboardInputValue) && field.onChange('');
|
||||||
date && dayjs(date).utc().isValid() && field.onChange(date.toISOString());
|
date && dayjs(date).utc().isValid() && field.onChange(dayjs(date).utc().toISOString());
|
||||||
}}
|
}}
|
||||||
renderInput={(params) => (
|
renderInput={(params) => (
|
||||||
<TextField
|
<TextField
|
||||||
|
|||||||
@ -134,7 +134,7 @@ const PublicationModal: React.FC = () => {
|
|||||||
views={['year', 'month', 'day']}
|
views={['year', 'month', 'day']}
|
||||||
onChange={(date: Date | null, keyboardInputValue: string | undefined) => {
|
onChange={(date: Date | null, keyboardInputValue: string | undefined) => {
|
||||||
isEmpty(keyboardInputValue) && field.onChange('');
|
isEmpty(keyboardInputValue) && field.onChange('');
|
||||||
date && dayjs(date).utc().isValid() && field.onChange(date.toISOString());
|
date && dayjs(date).utc().isValid() && field.onChange(dayjs(date).utc().toISOString());
|
||||||
}}
|
}}
|
||||||
renderInput={(params) => (
|
renderInput={(params) => (
|
||||||
<TextField
|
<TextField
|
||||||
|
|||||||
@ -140,7 +140,7 @@ const VolunteerModal: React.FC = () => {
|
|||||||
views={['year', 'month', 'day']}
|
views={['year', 'month', 'day']}
|
||||||
onChange={(date: Date | null, keyboardInputValue: string | undefined) => {
|
onChange={(date: Date | null, keyboardInputValue: string | undefined) => {
|
||||||
isEmpty(keyboardInputValue) && field.onChange('');
|
isEmpty(keyboardInputValue) && field.onChange('');
|
||||||
date && dayjs(date).utc().isValid() && field.onChange(date.toISOString());
|
date && dayjs(date).utc().isValid() && field.onChange(dayjs(date).utc().toISOString());
|
||||||
}}
|
}}
|
||||||
renderInput={(params) => (
|
renderInput={(params) => (
|
||||||
<TextField
|
<TextField
|
||||||
@ -164,7 +164,7 @@ const VolunteerModal: React.FC = () => {
|
|||||||
views={['year', 'month', 'day']}
|
views={['year', 'month', 'day']}
|
||||||
onChange={(date: Date | null, keyboardInputValue: string | undefined) => {
|
onChange={(date: Date | null, keyboardInputValue: string | undefined) => {
|
||||||
isEmpty(keyboardInputValue) && field.onChange('');
|
isEmpty(keyboardInputValue) && field.onChange('');
|
||||||
date && dayjs(date).utc().isValid() && field.onChange(date.toISOString());
|
date && dayjs(date).utc().isValid() && field.onChange(dayjs(date).utc().toISOString());
|
||||||
}}
|
}}
|
||||||
renderInput={(params) => (
|
renderInput={(params) => (
|
||||||
<TextField
|
<TextField
|
||||||
|
|||||||
@ -140,7 +140,7 @@ const WorkModal: React.FC = () => {
|
|||||||
views={['year', 'month', 'day']}
|
views={['year', 'month', 'day']}
|
||||||
onChange={(date: Date | null, keyboardInputValue: string | undefined) => {
|
onChange={(date: Date | null, keyboardInputValue: string | undefined) => {
|
||||||
isEmpty(keyboardInputValue) && field.onChange('');
|
isEmpty(keyboardInputValue) && field.onChange('');
|
||||||
date && dayjs(date).utc().isValid() && field.onChange(date.toISOString());
|
date && dayjs(date).utc().isValid() && field.onChange(dayjs(date).utc().toISOString());
|
||||||
}}
|
}}
|
||||||
renderInput={(params) => (
|
renderInput={(params) => (
|
||||||
<TextField
|
<TextField
|
||||||
@ -164,7 +164,7 @@ const WorkModal: React.FC = () => {
|
|||||||
views={['year', 'month', 'day']}
|
views={['year', 'month', 'day']}
|
||||||
onChange={(date: Date | null, keyboardInputValue: string | undefined) => {
|
onChange={(date: Date | null, keyboardInputValue: string | undefined) => {
|
||||||
isEmpty(keyboardInputValue) && field.onChange('');
|
isEmpty(keyboardInputValue) && field.onChange('');
|
||||||
date && dayjs(date).utc().isValid() && field.onChange(date.toISOString());
|
date && dayjs(date).utc().isValid() && field.onChange(dayjs(date).utc().toISOString());
|
||||||
}}
|
}}
|
||||||
renderInput={(params) => (
|
renderInput={(params) => (
|
||||||
<TextField
|
<TextField
|
||||||
|
|||||||
Reference in New Issue
Block a user