Skip to content

A one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever. Try it out today!

fix(client): :bug: fix mui rendering of utc dates

Amruth Pillai977fa72ddeee
diff --git a/client/components/shared/ResumeInput.tsx b/client/components/shared/ResumeInput.tsx
index 6eb232ad0..f87e8d6aa 100644
--- a/client/components/shared/ResumeInput.tsx
+++ b/client/components/shared/ResumeInput.tsx
@@ -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).utc().isValid() && onChangeValue(date.toISOString());
+ date && dayjs(date).utc().isValid() && onChangeValue(dayjs(date).utc().toISOString());
}}
/>
);
diff --git a/client/modals/builder/sections/AwardModal.tsx b/client/modals/builder/sections/AwardModal.tsx
index 6a655fdcf..5d2a9188c 100644
--- a/client/modals/builder/sections/AwardModal.tsx
+++ b/client/modals/builder/sections/AwardModal.tsx
@@ -134,7 +134,7 @@ const AwardModal: React.FC = () => {
views={['year', 'month', 'day']}
onChange={(date: Date | null, keyboardInputValue: string | undefined) => {
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) => (
<TextField
diff --git a/client/modals/builder/sections/CertificateModal.tsx b/client/modals/builder/sections/CertificateModal.tsx
index 9b4f81b9c..4b01fefef 100644
--- a/client/modals/builder/sections/CertificateModal.tsx
+++ b/client/modals/builder/sections/CertificateModal.tsx
@@ -134,7 +134,7 @@ const CertificateModal: React.FC = () => {
views={['year', 'month', 'day']}
onChange={(date: Date | null, keyboardInputValue: string | undefined) => {
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) => (
<TextField
diff --git a/client/modals/builder/sections/CustomModal.tsx b/client/modals/builder/sections/CustomModal.tsx
index 67f6573fc..6e2602d5d 100644
--- a/client/modals/builder/sections/CustomModal.tsx
+++ b/client/modals/builder/sections/CustomModal.tsx
@@ -150,7 +150,7 @@ const CustomModal: React.FC = () => {
views={['year', 'month', 'day']}
onChange={(date: Date | null, keyboardInputValue: string | undefined) => {
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) => (
<TextField
@@ -174,7 +174,7 @@ const CustomModal: React.FC = () => {
views={['year', 'month', 'day']}
onChange={(date: Date | null, keyboardInputValue: string | undefined) => {
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) => (
<TextField
diff --git a/client/modals/builder/sections/EducationModal.tsx b/client/modals/builder/sections/EducationModal.tsx
index b239326d2..72a6e34fd 100644
--- a/client/modals/builder/sections/EducationModal.tsx
+++ b/client/modals/builder/sections/EducationModal.tsx
@@ -173,7 +173,7 @@ const EducationModal: React.FC = () => {
views={['year', 'month', 'day']}
onChange={(date: Date | null, keyboardInputValue: string | undefined) => {
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) => (
<TextField
@@ -197,7 +197,7 @@ const EducationModal: React.FC = () => {
views={['year', 'month', 'day']}
onChange={(date: Date | null, keyboardInputValue: string | undefined) => {
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) => (
<TextField
diff --git a/client/modals/builder/sections/ProjectModal.tsx b/client/modals/builder/sections/ProjectModal.tsx
index c4e09e23b..774396e64 100644
--- a/client/modals/builder/sections/ProjectModal.tsx
+++ b/client/modals/builder/sections/ProjectModal.tsx
@@ -143,7 +143,7 @@ const ProjectModal: React.FC = () => {
views={['year', 'month', 'day']}
onChange={(date: Date | null, keyboardInputValue: string | undefined) => {
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) => (
<TextField
@@ -167,7 +167,7 @@ const ProjectModal: React.FC = () => {
views={['year', 'month', 'day']}
onChange={(date: Date | null, keyboardInputValue: string | undefined) => {
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) => (
<TextField
diff --git a/client/modals/builder/sections/PublicationModal.tsx b/client/modals/builder/sections/PublicationModal.tsx
index d1ed3270c..dcfb3f4cb 100644
--- a/client/modals/builder/sections/PublicationModal.tsx
+++ b/client/modals/builder/sections/PublicationModal.tsx
@@ -134,7 +134,7 @@ const PublicationModal: React.FC = () => {
views={['year', 'month', 'day']}
onChange={(date: Date | null, keyboardInputValue: string | undefined) => {
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) => (
<TextField
diff --git a/client/modals/builder/sections/VolunteerModal.tsx b/client/modals/builder/sections/VolunteerModal.tsx
index 20fecba7a..814ede3aa 100644
--- a/client/modals/builder/sections/VolunteerModal.tsx
+++ b/client/modals/builder/sections/VolunteerModal.tsx
@@ -140,7 +140,7 @@ const VolunteerModal: React.FC = () => {
views={['year', 'month', 'day']}
onChange={(date: Date | null, keyboardInputValue: string | undefined) => {
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) => (
<TextField
@@ -164,7 +164,7 @@ const VolunteerModal: React.FC = () => {
views={['year', 'month', 'day']}
onChange={(date: Date | null, keyboardInputValue: string | undefined) => {
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) => (
<TextField
diff --git a/client/modals/builder/sections/WorkModal.tsx b/client/modals/builder/sections/WorkModal.tsx
index 19f1d51d6..c1f380cad 100644
--- a/client/modals/builder/sections/WorkModal.tsx
+++ b/client/modals/builder/sections/WorkModal.tsx
@@ -140,7 +140,7 @@ const WorkModal: React.FC = () => {
views={['year', 'month', 'day']}
onChange={(date: Date | null, keyboardInputValue: string | undefined) => {
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) => (
<TextField
@@ -164,7 +164,7 @@ const WorkModal: React.FC = () => {
views={['year', 'month', 'day']}
onChange={(date: Date | null, keyboardInputValue: string | undefined) => {
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) => (
<TextField