mirror of
https://github.com/midou36o/midou36o.github.io
synced 2025-05-10 03:53:42 +05:30
20 lines
355 B
JavaScript
20 lines
355 B
JavaScript
export const convertDate = (published) => {
|
|
const months = {
|
|
1: 'Jan',
|
|
2: 'Feb',
|
|
3: 'Mar',
|
|
4: 'Apr',
|
|
5: 'May',
|
|
6: 'Jun',
|
|
7: 'Jul',
|
|
8: 'Aug',
|
|
9: 'Sep',
|
|
10: 'Oct',
|
|
11: 'Nov',
|
|
12: 'Dec'
|
|
};
|
|
const date = published.substring(0, 10);
|
|
const [year, month, day] = date.split('-');
|
|
return `${day}-${months[parseInt(month)]}-${year}`;
|
|
};
|