Skip to content

Commit 6d1711c

Browse files
authored
Merge pull request #5 from fatmabadri/fatmabadri-patch-5
Updated solution.md for calendar-table
2 parents 40ded91 + 1bcbb81 commit 6d1711c

File tree

1 file changed

+7
-7
lines changed
  • 2-ui/1-document/07-modifying-document/9-calendar-table

1 file changed

+7
-7
lines changed
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
We'll create the table as a string: `"<table>...</table>"`, and then assign it to `innerHTML`.
1+
Tabloyu bir string olarak oluşturacağız: `"<table>...</table>"` ve ardından `innerHTML`'ye atayacağız
22

3-
The algorithm:
3+
Algoritma:
44

5-
1. Create the table header with `<th>` and weekday names.
6-
1. Create the date object `d = new Date(year, month-1)`. That's the first day of `month` (taking into account that months in JavaScript start from `0`, not `1`).
7-
2. First few cells till the first day of the month `d.getDay()` may be empty. Let's fill them in with `<td></td>`.
8-
3. Increase the day in `d`: `d.setDate(d.getDate()+1)`. If `d.getMonth()` is not yet the next month, then add the new cell `<td>` to the calendar. If that's a Sunday, then add a newline <code>"&lt;/tr&gt;&lt;tr&gt;"</code>.
9-
4. If the month has finished, but the table row is not yet full, add empty `<td>` into it, to make it square.
5+
1. Tablo başlığını `<th>` ve hafta içi isimleri ile oluşturun..
6+
1. Tarih nesnesini `d = new Date(year, month-1)` oluşturun. Bu, ayın ilk günüdür (JavaScript'te ayların `1`den değil, `0`dan başladığını hesaba katarak)
7+
2. Ayın ilk gününe kadar ilk birkaç hücre `d.getDay()` boş olabilir. Onları `<td></td>` ile dolduralım.
8+
3. `d`: `d.setDate(d.getDate()+1)` içindeki günü artırın. Eğer `d.getMonth()` henüz gelecek ay değilse, ondan sonra takvime yeni hücre ekle. Eğer bu bir Pazar günüyse, yeni bir satır <code>"&lt;/tr&gt;&lt;tr&gt;"</code>'i ekleyin.
9+
4. Eğer ay bitmişse, ama tablo sırası dolu değil, onu kare yapmak için içine boş `<td>` ekleyin

0 commit comments

Comments
 (0)