17 lines
591 B
Markdown
17 lines
591 B
Markdown
importance: 4
|
|
|
|
---
|
|
|
|
# Create a calendar
|
|
|
|
Write a function `createCalendar(elem, year, month)`.
|
|
|
|
The call should create a calendar for the given year/month and put it inside `elem`.
|
|
|
|
The calendar should be a table, where a week is `<tr>`, and a day is `<td>`. The table top should be `<th>` with weekday names: the first day should be Monday, and so on till Sunday.
|
|
|
|
For instance, `createCalendar(cal, 2012, 9)` should generate in element `cal` the following calendar:
|
|
|
|
[iframe height=210 src="solution"]
|
|
|
|
P.S. For this task it's enough to generate the calendar, should not yet be clickable.
|