Skip to content
View akmj3011's full-sized avatar

Block or report akmj3011

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Please don't include any personal information such as legal names or email addresses. Maximum 100 characters, markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
akmj3011/README.md
<title>캘린더</title>
<textarea id="memo-text"></textarea> 저장 취소
<script> const calendarContainer = document.getElementById('calendar-container'); const memoContainer = document.getElementById('memo-container'); const memoText = document.getElementById('memo-text');

let currentDate;

function renderCalendar(year, month) { const today = new Date(year, month, 1); const lastDay = new Date(year, month + 1, 0).getDate();

let html = '

'; html += ''; html += ''; html += '';

let day = 1; for (let i = 0; i < 6; i++) { html += '

'; for (let j = 0; j < 7; j++) { if (i === 0 && j < today.getDay()) { html += ''; } else if (day > lastDay) { html += ''; } else { html += ''; day++; } } html += ''; } html += '
' + today.toLocaleDateString('en-US', { month: 'long', year: 'numeric' }) + '
SunMonTueWedThuFriSat
' + day + '
'; html += '
';

return html; }

function showMemo(day) { currentDate = new Date(new Date().getFullYear(), new Date().getMonth(), day); memoText.value = localStorage.getItem(currentDate.toISOString()) || ''; memoContainer.style.display = 'block'; }

function saveMemo() { localStorage.setItem(currentDate.toISOString(), memoText.value); memoContainer.style.display = 'none'; renderCalendar(currentDate.getFullYear(), currentDate.getMonth()); }

function cancelMemo() { memoContainer.style.display = 'none'; }

// 현재 월을 기준으로 앞뒤 3개월씩 캘린더 생성 let today = new Date(2023, 5, 1); let year = today.getFullYear(); let month = today.getMonth(); for (let i = -1; i <= 1; i++) { let calendarDiv = document.createElement('div'); calendarDiv.classList.add('calendar'); calendarDiv.innerHTML = renderCalendar(year, month + i); calendarContainer.appendChild(calendarDiv); } </script>

Popular repositories Loading

  1. Test3D Test3D Public

    Forked from cheneyls/Test3D

    C#

  2. akmj3011 akmj3011 Public

    프론트엔드 개발 챌린지 10기

  3. kmj3011 kmj3011 Public

  4. -10- -10- Public

  5. kmj30111 kmj30111 Public

  6. akmj30111 akmj30111 Public