Shun Miyazawa 3 лет назад
Родитель
Сommit
f2a7288e43
1 измененных файлов с 2 добавлено и 10 удалено
  1. 2 10
      packages/app/src/components/ShareLink/ShareLinkForm.tsx

+ 2 - 10
packages/app/src/components/ShareLink/ShareLinkForm.tsx

@@ -33,14 +33,6 @@ export const ShareLinkForm: FC<Props> = (props: Props) => {
 
   const { data: currentPageId } = useCurrentPageId();
 
-  const formatDate = useCallback((date) => {
-    return format(date, 'yyyy-MM-dd');
-  }, []);
-
-  const formatTime = useCallback((date) => {
-    return format(date, 'HH:mm');
-  }, []);
-
   const handleChangeExpirationType = useCallback((expirationType: ExpirationType) => {
     setExpirationType(expirationType);
   }, []);
@@ -180,7 +172,7 @@ export const ShareLinkForm: FC<Props> = (props: Props) => {
                   type="date"
                   className="ml-3 mb-2"
                   name="customExpirationDate"
-                  value={formatDate(customExpirationDate)}
+                  value={format(customExpirationDate, 'yyyy-MM-dd')}
                   onFocus={() => { handleChangeExpirationType(ExpirationType.CUSTOM) }}
                   onChange={e => handleChangeCustomExpirationDate(e.target.value)}
                 />
@@ -188,7 +180,7 @@ export const ShareLinkForm: FC<Props> = (props: Props) => {
                   type="time"
                   className="ml-3 mb-2"
                   name="customExpiration"
-                  value={formatTime(customExpirationTime)}
+                  value={format(customExpirationTime, 'HH:mm')}
                   onFocus={() => { handleChangeExpirationType(ExpirationType.CUSTOM) }}
                   onChange={e => handleChangeCustomExpirationTime(e.target.value)}
                 />