@@ -7,24 +7,24 @@ const endDate = new Date(year, month + 1, 0);
77const calender = document . getElementById ( "calender" ) ;
88const button = document . getElementById ( "button" ) ;
99
10- //編集中の予定を追うための変数
10+ // 編集中の予定を追うための変数
1111let editedLi = null ;
1212
13- //各日付の要素を格納するオブジェクト
13+ // 各日付の要素を格納するオブジェクト
1414const container = { } ;
1515
16- //曜日の行を作成
16+ // 曜日の行を作成
1717const firstRow = document . createElement ( "tr" ) ;
1818for ( let i = 0 ; i < 7 ; i += 1 ) {
1919 const th = document . createElement ( "th" ) ;
2020 th . textContent = days [ i ] ;
2121 firstRow . appendChild ( th ) ;
2222}
2323
24- //曜日の行を追加
24+ // 曜日の行を追加
2525calender . appendChild ( firstRow ) ;
2626
27- //日付の行を作成
27+ // 日付の行を作成
2828for ( let x = 1 ; x <= 6 ; x += 1 ) {
2929 const tr = document . createElement ( "tr" ) ;
3030 calender . appendChild ( tr ) ;
@@ -51,7 +51,7 @@ for (let i = 1; i <= 42; i += 1) {
5151 }
5252}
5353
54- //予定を追加する関数
54+ // 予定を追加する関数
5555function addTask ( e ) {
5656 const li = document . createElement ( "li" ) ;
5757 const input = document . createElement ( "input" ) ;
@@ -61,7 +61,7 @@ function addTask(e) {
6161 editedLi = li ;
6262}
6363
64- //予定を固定する関数
64+ // 予定を固定する関数
6565function fixTask ( e ) {
6666 if ( e . keyCode === 13 ) {
6767 const input = editedLi . firstChild ;
@@ -78,7 +78,7 @@ function fixTask(e) {
7878 }
7979}
8080
81- //予定を編集できるようにする関数
81+ // 予定を編集できるようにする関数
8282function editTask ( e ) {
8383 editedLi = e . target . parentNode ;
8484 const input = document . createElement ( "input" ) ;
@@ -87,17 +87,17 @@ function editTask(e) {
8787 editedLi . replaceChild ( input , editedLi . firstChild ) ;
8888}
8989
90- //予定を消す関数
90+ // 予定を消す関数
9191function deleteTask ( ) {
9292 editedLi . remove ( ) ;
9393 button . style . visibility = "hidden" ;
9494 editedLi = null ;
9595}
9696
97- //クリックしたときに実行される関数
97+ // クリックしたときに実行される関数
9898
9999function clicked ( e ) {
100- //予定を編集していないとき
100+ // 予定を編集していないとき
101101
102102 if ( editedLi === null ) {
103103 if ( e . target . class === "task" ) {
@@ -111,7 +111,7 @@ function clicked(e) {
111111 addTask ( e ) ;
112112 }
113113 }
114- //予定を編集中の時
114+ // 予定を編集中の時
115115 else {
116116 if ( e . target . tagName !== "INPUT" && e . target . tagName !== "BUTTON" ) {
117117 button . style . visibility = "hidden" ;
0 commit comments