Skip to content

Commit

Permalink
calc and add timezone diff (#31)
Browse files Browse the repository at this point in the history
Co-authored-by: Paris Smirlakis <[email protected]>
  • Loading branch information
SmirlakisParis and smirlakis authored Oct 3, 2024
1 parent 8731abd commit c94edba
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/client/components/molecules/BookingGuestInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ export const BookingGuestInfo: React.FC = () => {
render={({ field }) => (
<DatePickerField
label="Check-in Date *"
value={field.value ? new Date(field.value) : null}
onChange={(date) => field.onChange(date ? date.toISOString() : '')}
value={field.value ? new Date(field.value ) : null}
onChange={(date) => field.onChange((date) ? new Date(date.getTime() - date.getTimezoneOffset() * 60000).toISOString() : '' )}
error={errors.checkIn?.message as string | undefined}
/>
)}
Expand All @@ -49,7 +49,7 @@ export const BookingGuestInfo: React.FC = () => {
<DatePickerField
label="Check-out Date *"
value={field.value ? new Date(field.value) : null}
onChange={(date) => field.onChange(date ? date.toISOString() : '')}
onChange={(date) => field.onChange( (date) ? new Date(date.getTime() - date.getTimezoneOffset() * 60000).toISOString() : '')}
error={errors.checkOut?.message as string | undefined}
/>
)}
Expand Down

0 comments on commit c94edba

Please sign in to comment.