a2n-seattle / a2n-seattle/rms-app
Default borrow time to now and return-by time to +1 day
- 主要言語
- TypeScript
- スター
- 1
- フォーク
- 1
- 平均マージ
- 27分
- マージ済み PR(30日)
- 4
説明
# Why?
**As a** user borrowing or reserving an item
**I want** sensible defaults pre-filled in the time fields
**So that** I don't have to manually enter the current date/time or compute "one day from now" for the common case.
# What?
In the borrow/reserve forms (wherever `start`/`end` time inputs are rendered — `items/[id]/page.tsx`'s reserve form and/or the basket/dashboard borrow prompts from later phases):
- Default the **borrow time** field to the current date/time.
- Default the **return-by time** field to exactly 1 day (24h) after the borrow/start time, same time-of-day.
Should apply consistently across every place a borrow/reserve time is collected (single-item reserve form, basket-style multi-select borrow/reserve prompt, one-click row actions), not just one entry point.
# Testing
Jest/RTL test asserting the default field values on initial render (e.g. mock a fixed `Date.now()` and assert the rendered `start`/`end` input values).
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
この issue では `items/[id]/page.tsx` と他の borrow/reserve フォームに触れています。まず、`start`/`end` の時刻入力を処理するフォームコンポーネントを特定してください。`Date.now()` を使用してデフォルトの貸出時刻を設定し、返却期限の時刻をその 24 時間後として計算します。初回ロード時にデフォルト値が正しくレンダリングされることを検証する Jest/RTL テストを書いてください。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- react
- 領域
- frontend
- issue の種類
- 機能追加
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 静か
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 75/100