diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/DashboardWidgets/News.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/DashboardWidgets/News.vue
index 5c360e937..3c8fcb295 100644
--- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/DashboardWidgets/News.vue
+++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/DashboardWidgets/News.vue
@@ -16,7 +16,9 @@
{{ item.title }}
- {{ formatDate(item.startdate) }}
+
+ {{ $t('widget.news.date') }}: {{ formatDate(item.startdate.date) }}
+
@@ -31,7 +33,7 @@ import { makeFetch } from '../../../lib/api/apiMethods';
import Modal from '../../_components/Modal.vue'; // Adjust the import path
import { marked } from 'marked';
import DOMPurify from 'dompurify';
-import { NewsItem } from '../../../types';
+import {DateTime, NewsItem} from '../../../types';
const newsItems = ref([])
const selectedArticle = ref(null);
@@ -69,13 +71,13 @@ const prepareContent = (content: string, maxLength = 100): string => {
return convertMarkdownToHtml(truncatedContent);
};
-const formatDate = (datetime: { date: string }): string => {
- return new Date(datetime.date).toDateString()
+const formatDate = (datetime: DateTime): string => {
+ return new Date(datetime.toString()).toLocaleDateString()
}
onMounted(() => {
makeFetch('GET', '/api/1.0/main/news.json')
- .then((response: {results: NewsItem[]}) => {
+ .then((response: { results: NewsItem[] }) => {
// console.log('news articles', response.results)
newsItems.value = response.results
})
diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_js/i18n.ts b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_js/i18n.ts
index 54e136e08..05b115928 100644
--- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_js/i18n.ts
+++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_js/i18n.ts
@@ -55,7 +55,8 @@ const messages = {
widget: {
news: {
title: "Actualités",
- readMore: "Lire la suite"
+ readMore: "Lire la suite",
+ date: "Date"
}
}
}