Skip to content

Commit

Permalink
Merge pull request #32 from farhoudshapouran/change-time-mode-value
Browse files Browse the repository at this point in the history
fix: value changes in time mode
  • Loading branch information
farhoudshapouran authored Nov 1, 2023
2 parents a631a0f + aa4767d commit caefa22
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/DateTimePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,7 @@ const DateTimePicker = ({
setCalendarView: (view: CalendarViews) =>
dispatch({ type: CalendarActionKind.SET_CALENDAR_VIEW, payload: view }),
onSelectDate: (date: DateType) => {
onValueChange(
state.mode === 'time'
? utils.getTimeFormated(date)
: state.mode === 'date'
? utils.getDateFormated(date)
: date
);
onValueChange(date);
dispatch({
type: CalendarActionKind.CHANGE_SELECTED_DATE,
payload: date,
Expand Down

0 comments on commit caefa22

Please sign in to comment.