O'Reilly logo

Practical Web Technologies by V. Lau, P. K. Yuen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

12.4. Generating calendars

12.4.1. Adding a month calendar to a page

Without doubt, another popular use of the date object is to generate a calendar. Since we know how to get the year, month, and date from a date object, to generate a calendar is just a formatting process. Our first aim here is to generate the current month calendar to a page. Consider the following example code ex12-18.htm:

Example. ex12–18.htm – A Page To Show A Month Calendar
 1: <?xml version="1.0" encoding="iso-8859–1"?> 2: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 3: "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 4: <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 5: <head><title>A Month Calendar -- ex12–18.htm</title></head> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required