diff --git a/src/components/Home/BlogSection.js b/src/components/Home/BlogSection.js
index 8d83f40..be50db1 100644
--- a/src/components/Home/BlogSection.js
+++ b/src/components/Home/BlogSection.js
@@ -2,6 +2,9 @@ import { BlogData } from "@/utils/constant.utils";
import Link from "next/link";
const BlogSection = () => {
+
+ const sortedBlogs = [...BlogData].sort((a, b) => new Date(b.date) - new Date(a.date)).slice(0, 3);
+
return (
@@ -15,7 +18,7 @@ const BlogSection = () => {
{
- BlogData?.slice(0, 3)?.map((blog) => {
+ sortedBlogs?.map((blog) => {
return (
@@ -26,9 +29,11 @@ const BlogSection = () => {
*/}
-
{blog?.title.length > 50
- ? blog.title.substring(0, 50) + '...'
- : blog.title}
+
+ {blog?.title.length > 50
+ ? blog.title.substring(0, 50) + '...'
+ : blog.title}
+
{blog?.date}