교육과정, 강의등록 완료1
This commit is contained in:
@@ -6,6 +6,24 @@ import CourseRegistrationModal from "./CourseRegistrationModal";
|
||||
import ChevronDownSvg from "@/app/svgs/chevrondownsvg";
|
||||
import { getCourses, type Course } from "./mockData";
|
||||
|
||||
// 날짜를 yyyy-mm-dd 형식으로 변환하는 함수
|
||||
const formatDate = (dateString: string): string => {
|
||||
if (!dateString) return '';
|
||||
try {
|
||||
const date = new Date(dateString);
|
||||
const year = date.getFullYear();
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(date.getDate()).padStart(2, '0');
|
||||
return `${year}-${month}-${day}`;
|
||||
} catch {
|
||||
// 이미 yyyy-mm-dd 형식이거나 파싱 실패 시 원본 반환
|
||||
if (dateString.includes('T')) {
|
||||
return dateString.split('T')[0];
|
||||
}
|
||||
return dateString;
|
||||
}
|
||||
};
|
||||
|
||||
export default function AdminCoursesPage() {
|
||||
const [courses, setCourses] = useState<Course[]>([]);
|
||||
const [isLoading, setIsLoading] = useState(true);
|
||||
@@ -199,7 +217,7 @@ export default function AdminCoursesPage() {
|
||||
{course.instructorName}
|
||||
</td>
|
||||
<td className="border-t border-r border-[#dee1e6] px-4 text-[13px] leading-[1.5] text-[#1b2027] whitespace-nowrap">
|
||||
{course.createdAt}
|
||||
{formatDate(course.createdAt)}
|
||||
</td>
|
||||
<td className="border-t border-[#dee1e6] px-4 text-left text-[13px] leading-[1.5] text-[#1b2027] whitespace-nowrap">
|
||||
{course.hasLessons ? (
|
||||
|
||||
Reference in New Issue
Block a user