fix(client): 🐛 attempt to fix the one-off date issue

use utc functions from dayjs to correspond to the same date on the server
This commit is contained in:
Amruth Pillai
2022-07-31 02:13:08 -08:00
parent 1c19062c63
commit 5197f954c0
14 changed files with 33 additions and 25 deletions

View File

@ -63,7 +63,7 @@ const ResumeInput: React.FC<Props> = ({ type = 'text', label, path, className, m
renderInput={(params) => <TextField {...params} error={false} className={className} />}
onChange={(date: Date | null, keyboardInputValue: string | undefined) => {
isEmpty(keyboardInputValue) && onChangeValue('');
date && dayjs(date).isValid() && onChangeValue(date.toISOString());
date && dayjs(date).utc().isValid() && onChangeValue(date.toISOString());
}}
/>
);