feat: オリジナルの作成日時追加( #101#117

Merged
みてるぞ merged 5 commits from '#101' into main 2025-09-22 05:05:31 +09:00
2 changed files with 8 additions and 3 deletions
Showing only changes of commit 537c94a34b - Show all commits
+2
View File
@@ -62,12 +62,14 @@ export default (({ post, onSave }: Props) => {
<Label></Label>
<div className="my-1">
<DateTimeField
className="mr-2"
value={originalCreatedFrom ?? undefined}
onChange={setOriginalCreatedFrom}/>
miteruzo marked this conversation as resolved Outdated
Outdated
Review

オリジナルの作成日時(以降),変更時にオリジナルの作成日時(より前)が自動設定されるやぅにしたぃ.
基本は +1 秒,秒が 0 なら +1 分,分、秒が 0 なら +1 日.

オリジナルの作成日時(以降),変更時にオリジナルの作成日時(より前)が自動設定されるやぅにしたぃ. 基本は +1 秒,秒が 0 なら +1 分,分、秒が 0 なら +1 日.
</div>
<div className="my-1">
<DateTimeField
className="mr-2"
value={originalCreatedBefore ?? undefined}
onChange={setOriginalCreatedBefore}/>
@@ -1,5 +1,7 @@
import { useEffect, useState } from 'react'
import { cn } from '@/lib/utils'
import type { FC } from 'react'
@@ -19,10 +21,11 @@ const toDateTimeLocalValue = (d: Date) => {
type Props = {
value?: string
onChange?: (isoUTC: string | null) => void }
onChange?: (isoUTC: string | null) => void
className?: string }
export default (({ value, onChange }: Props) => {
export default (({ value, onChange, className }: Props) => {
const [local, setLocal] = useState ('')
useEffect (() => {
@@ -31,7 +34,7 @@ export default (({ value, onChange }: Props) => {
miteruzo marked this conversation as resolved
Review

“以降”、“より前” までの距離が窮屈なので mr-1 欲しぃかも.

“以降”、“より前” までの距離が窮屈なので `mr-1` 欲しぃかも.
return (
<input
className="border rounded p-2"
className={cn ('border rounded p-2', className)}
type="datetime-local"
step={1}
value={local}