J0BL1N commited on
Commit
14980eb
·
verified ·
1 Parent(s): 7f20ab3

I want the current date next to the Calendar title.

Browse files
Files changed (1) hide show
  1. index.html +16 -5
index.html CHANGED
@@ -85,8 +85,11 @@
85
  <!-- Header -->
86
  <header class="mb-6 sm:mb-8">
87
  <div class="flex flex-col sm:flex-row items-start sm:items-center justify-between mb-4 sm:mb-6 gap-4">
88
- <h1 class="text-2xl sm:text-3xl font-bold text-gray-800">Calendar</h1>
89
- <div class="flex items-center space-x-2 sm:space-x-4">
 
 
 
90
  <button id="prev-month" class="p-2 rounded-full hover:bg-white/50 transition-colors">
91
  <i data-feather="chevron-left" class="w-4 h-4 sm:w-5 sm:h-5"></i>
92
  </button>
@@ -206,10 +209,18 @@
206
  root.style.setProperty(`--${color}-${shade}`, value);
207
  });
208
  });
209
- AOS.init();
210
  feather.replace();
211
-
212
- let currentDate = new Date();
 
 
 
 
 
 
 
 
213
  let events = JSON.parse(localStorage.getItem('calendarEvents')) || [];
214
  function updateCalendar() {
215
  const calendar = document.getElementById('calendar');
 
85
  <!-- Header -->
86
  <header class="mb-6 sm:mb-8">
87
  <div class="flex flex-col sm:flex-row items-start sm:items-center justify-between mb-4 sm:mb-6 gap-4">
88
+ <div>
89
+ <h1 class="text-2xl sm:text-3xl font-bold text-gray-800">Calendar</h1>
90
+ <p class="text-sm text-gray-500" id="current-date"></p>
91
+ </div>
92
+ <div class="flex items-center space-x-2 sm:space-x-4">
93
  <button id="prev-month" class="p-2 rounded-full hover:bg-white/50 transition-colors">
94
  <i data-feather="chevron-left" class="w-4 h-4 sm:w-5 sm:h-5"></i>
95
  </button>
 
209
  root.style.setProperty(`--${color}-${shade}`, value);
210
  });
211
  });
212
+ AOS.init();
213
  feather.replace();
214
+
215
+ // Display current date
216
+ const currentDateElement = document.getElementById('current-date');
217
+ const today = new Date();
218
+ currentDateElement.textContent = today.toLocaleDateString('en-US', {
219
+ weekday: 'long',
220
+ month: 'long',
221
+ day: 'numeric'
222
+ });
223
+ let currentDate = new Date();
224
  let events = JSON.parse(localStorage.getItem('calendarEvents')) || [];
225
  function updateCalendar() {
226
  const calendar = document.getElementById('calendar');