オリジナルの投稿日時 Safari でのバグ修正(#129) (#265)
Merge branch 'main' into feature/129 #129 Co-authored-by: miteruzo <miteruzo@naver.com> Reviewed-on: #265
This commit was merged in pull request #265.
This commit is contained in:
@@ -5,7 +5,7 @@ import { cn } from '@/lib/utils'
|
||||
import type { FC, FocusEvent } from 'react'
|
||||
|
||||
|
||||
const pad = (n: number) => n.toString ().padStart (2, '0')
|
||||
const pad = (n: number): string => n.toString ().padStart (2, '0')
|
||||
|
||||
|
||||
const toDateTimeLocalValue = (d: Date) => {
|
||||
@@ -14,8 +14,7 @@ const toDateTimeLocalValue = (d: Date) => {
|
||||
const day = pad (d.getDate ())
|
||||
const h = pad (d.getHours ())
|
||||
const min = pad (d.getMinutes ())
|
||||
const s = pad (d.getSeconds ())
|
||||
return `${ y }-${ m }-${ day }T${ h }:${ min }:${ s }`
|
||||
return `${ y }-${ m }-${ day }T${ h }:${ min }:00`
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +36,6 @@ export default (({ value, onChange, className, onBlur }: Props) => {
|
||||
<input
|
||||
className={cn ('border rounded p-2', className)}
|
||||
type="datetime-local"
|
||||
step={1}
|
||||
value={local}
|
||||
onChange={ev => {
|
||||
const v = ev.target.value
|
||||
|
||||
Reference in New Issue
Block a user