feat: 운송장 번호 자동 정리 + 날짜에 요일 표시
- 운송장 번호 입력 시 공백/하이픈 실시간 제거 - 택배 카드 날짜에 요일 추가 (월, 화, ...) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
428cb99423
commit
9d2055fa7c
2 changed files with 4 additions and 3 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
import { useQuery } from "@tanstack/react-query";
|
import { useQuery } from "@tanstack/react-query";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
|
import "dayjs/locale/ko";
|
||||||
import StatusBadge from "./StatusBadge";
|
import StatusBadge from "./StatusBadge";
|
||||||
import { fetchCarriers } from "@/api/parcels";
|
import { fetchCarriers } from "@/api/parcels";
|
||||||
|
|
||||||
|
|
@ -34,7 +35,7 @@ function ParcelCard({ parcel, onClick }) {
|
||||||
|
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<span className="text-xs lg:text-sm text-gray-400">
|
<span className="text-xs lg:text-sm text-gray-400">
|
||||||
{dayjs(parcel.created_at).format("YYYY.MM.DD")}
|
{dayjs(parcel.created_at).locale("ko").format("YYYY.MM.DD (dd)")}
|
||||||
</span>
|
</span>
|
||||||
<StatusBadge status={parcel.status} />
|
<StatusBadge status={parcel.status} />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ function ParcelForm({ onClose }) {
|
||||||
setError("");
|
setError("");
|
||||||
mutation.mutate({
|
mutation.mutate({
|
||||||
carrierId,
|
carrierId,
|
||||||
trackingNumber: trackingNumber.replace(/\s/g, ""),
|
trackingNumber: trackingNumber.replace(/[\s\-]/g, ""),
|
||||||
label: label || undefined,
|
label: label || undefined,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
@ -69,7 +69,7 @@ function ParcelForm({ onClose }) {
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
value={trackingNumber}
|
value={trackingNumber}
|
||||||
onChange={(e) => setTrackingNumber(e.target.value)}
|
onChange={(e) => setTrackingNumber(e.target.value.replace(/[\s\-]/g, ""))}
|
||||||
placeholder="운송장 번호 입력"
|
placeholder="운송장 번호 입력"
|
||||||
className="w-full border border-gray-300 rounded-lg px-3 lg:px-4 py-2 lg:py-2.5 text-sm lg:text-base focus:outline-none focus:ring-2 focus:ring-primary/30 focus:border-primary"
|
className="w-full border border-gray-300 rounded-lg px-3 lg:px-4 py-2 lg:py-2.5 text-sm lg:text-base focus:outline-none focus:ring-2 focus:ring-primary/30 focus:border-primary"
|
||||||
required
|
required
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue