| 52 | |
| 53 | // Function to format date |
| 54 | const formatDate = (dateString) => { |
| 55 | const date = new Date(dateString); |
| 56 | |
| 57 | const year = date.getFullYear().toString().slice(-2); // Get last 2 digits of the year |
| 58 | const month = ('0' + (date.getMonth() + 1)).slice(-2); // Add leading zero for single-digit months |
| 59 | const day = ('0' + date.getDate()).slice(-2); // Add leading zero for single-digit days |
| 60 | const hours = ('0' + date.getHours()).slice(-2); // Add leading zero for single-digit hours |
| 61 | const minutes = ('0' + date.getMinutes()).slice(-2); // Add leading zero for single-digit minutes |
| 62 | |
| 63 | // Format the date and time |
| 64 | return `${day}/${month}/${year} | ${hours}:${minutes}`; |
| 65 | }; |
| 66 | |
| 67 | // Max Length for title and description |
| 68 | const maxTitleLength = 30; |