mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-07-11 13:35:13 +10:00
Merge pull request #528 from lpmi-13/set_present_as_end_date
update Project data model to use "Present" if no end date selected
This commit is contained in:
@@ -10,7 +10,8 @@ import ModalEvents from '../../constants/ModalEvents';
|
||||
const initialValues = {
|
||||
title: '',
|
||||
link: '',
|
||||
date: '',
|
||||
startDate: '',
|
||||
endDate: '',
|
||||
summary: '',
|
||||
};
|
||||
|
||||
@@ -20,7 +21,13 @@ const ProjectModal = () => {
|
||||
const schema = Yup.object().shape({
|
||||
title: Yup.string().required(t('shared.forms.validation.required')),
|
||||
link: Yup.string().url(t('shared.forms.validation.url')),
|
||||
date: Yup.date().max(new Date()),
|
||||
startDate: Yup.date(),
|
||||
endDate: Yup.date().when(
|
||||
'startDate',
|
||||
(startDate, yupSchema) =>
|
||||
startDate &&
|
||||
yupSchema.min(startDate, t('shared.forms.validation.dateRange')),
|
||||
),
|
||||
summary: Yup.string(),
|
||||
});
|
||||
|
||||
@@ -54,7 +61,7 @@ const ProjectModal = () => {
|
||||
type="date"
|
||||
label={t('shared.forms.startDate')}
|
||||
placeholder="6th August 2018"
|
||||
{...getFieldProps(formik, schema, 'date')}
|
||||
{...getFieldProps(formik, schema, 'startDate')}
|
||||
/>
|
||||
|
||||
<Input
|
||||
|
||||
@@ -17,12 +17,12 @@ const ProjectItem = ({ item, language }) => {
|
||||
</a>
|
||||
)}
|
||||
</div>
|
||||
{item.date && (
|
||||
{item.startDate && (
|
||||
<h6 className="text-xs font-medium text-right">
|
||||
(
|
||||
{formatDateRange(
|
||||
{
|
||||
startDate: item.date,
|
||||
startDate: item.startDate,
|
||||
endDate: item.endDate,
|
||||
language,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user