fix created at
This commit is contained in:
parent
4f1a7cc434
commit
8c67784d62
2 changed files with 13 additions and 1 deletions
|
|
@ -13,6 +13,17 @@ export const MySurveyList = () => {
|
|||
const navigate = useNavigate();
|
||||
const [surveys, setSurveys] = useState<MySurveyItem[]>([]);
|
||||
|
||||
const formatDate = (dateString: string) => {
|
||||
const date = new Date(dateString);
|
||||
const day = String(date.getDate()).padStart(2, '0');
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0');
|
||||
const year = date.getFullYear();
|
||||
const hours = String(date.getHours()).padStart(2, '0');
|
||||
const minutes = String(date.getMinutes()).padStart(2, '0');
|
||||
|
||||
return `${day}/${month}/${year} ${hours}:${minutes}`;
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
const fetchSurvey = async () => {
|
||||
try {
|
||||
|
|
@ -63,7 +74,7 @@ export const MySurveyList = () => {
|
|||
<h1 className={styles.title}>{survey.title}</h1>
|
||||
<h2 className={styles.description}>{survey.description}</h2>
|
||||
</div>
|
||||
<span className={styles.date}>Дата создания: {survey.createdBy}</span>
|
||||
<span className={styles.date}>Дата создания: {formatDate(survey.createdAt)}</span>
|
||||
</div>
|
||||
<div className={styles.container}>
|
||||
<div className={`${styles.status} ${
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue