- updates;

This commit is contained in:
Vitalii Kiiko
2024-10-22 17:41:14 +02:00
parent fd9cf2e393
commit b075e7259c
3 changed files with 58 additions and 13 deletions

View File

@@ -1,4 +1,4 @@
import React, { useEffect } from 'react';
import React from 'react';
import { classNames } from 'primereact/utils';
import { Controller } from 'react-hook-form';
import { is } from 'ramda';
@@ -18,6 +18,7 @@ const Datepicker = ({
disabled = false,
timeOnly = false
}) => {
console.log('defaultValue', defaultValue)
return (
<>
<label htmlFor={fieldName} className={classNames({ 'p-error': errors[fieldName] })}>
@@ -31,7 +32,7 @@ const Datepicker = ({
render={({ field, fieldState }) => (
<Calendar id={field.name}
disabled={disabled}
value={is(String, field.value) ? new Date(field.value) : field.value}
value={is(Date, field.value) ? field.value : null}
onChange={(e) => field.onChange(e.value)}
dateFormat="dd/mm/yy"
hourFormat="24"