Skip to content

Commit

Permalink
Merge pull request divyansh-2005#111 from DiwareNamrata23/feature-110
Browse files Browse the repository at this point in the history
added changes in month
  • Loading branch information
divyansh-2005 authored Oct 13, 2024
2 parents 7c0776b + 28224d7 commit 508d319
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
7 changes: 6 additions & 1 deletion FRONTEND/src/components/Calendar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ const Calendar = ({ onDateClick }) => {
const [currentMonth, setCurrentMonth] = useState(new Date().getMonth());
const [currentYear, setCurrentYear] = useState(new Date().getFullYear());

const monthNames = [
'January', 'February', 'March', 'April', 'May', 'June',
'July', 'August', 'September', 'October', 'November', 'December'
];

const handleDayClick = (day) => {
setActiveDay(day);
const selectedDate = new Date(currentYear, currentMonth, day);
Expand Down Expand Up @@ -46,7 +51,7 @@ const Calendar = ({ onDateClick }) => {
<div className="calendar">
<div className="calendar-nav">
<div className="nav-left">
<div className="current-month">{`${currentMonth + 1}/${currentYear}`}</div>
<div className="current-month">{`${monthNames[currentMonth]} ${currentYear}`}</div>
</div>
<div className="nav-right">
<button className="btn" onClick={handlePrevMonth}>
Expand Down
8 changes: 7 additions & 1 deletion FRONTEND/src/styles/Calendar.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,14 @@
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
justify-content: center; /* Center content horizontally */
}
.current-month {
font-size: 1.8em;
font-weight: bold;
text-align: center; /* Align the text to the center */

}

.nav-left {
display: flex;
align-items: center;
Expand Down

0 comments on commit 508d319

Please sign in to comment.