Browse Source

feat: automate adding duration

pull/5/head
wahyun 4 months ago
parent
commit
74d8250013
  1. 8
      src/views/SimproV2/CreatedProyek/DialogFormProyek.js

8
src/views/SimproV2/CreatedProyek/DialogFormProyek.js

@ -389,10 +389,18 @@ const DialogFormProyek = ({
const handleDatePickerStart = (date, dateString) => { const handleDatePickerStart = (date, dateString) => {
setStartDate(date); setStartDate(date);
if (endDate) {
const duration = moment(endDate).diff(moment(date), 'days');
setProjectDuration(duration);
}
}; };
const handleDatePickerEnd = (date, dateString) => { const handleDatePickerEnd = (date, dateString) => {
setEndDate(date); setEndDate(date);
if (startDate) {
const duration = moment(date).diff(moment(startDate), 'days');
setProjectDuration(duration);
}
}; };
const nextStep = () => { const nextStep = () => {

Loading…
Cancel
Save