• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

generating calendar using given date

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,

the application shud be like...i have to enter a date of a month and the day of the week, and the corresponding year's calendar has to be generated.
suppose if i enter 31 march, thursday.
then it has to generate the calendar of this year relative to the date and day i have given
and leap year consideration need not be there also.
pls help me in this regard

thanks in advance.
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Doesn't seem to have much to do with JSP so I'm moving this along to the Java in General (intermediate) forum.

You may want to check out the java.util.Calendar class.
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is your question about laying out the page? How many rows do I need, which box is the first day of the month in, how many days are in the month?

This is fun stuff to work with. Think out a data structure that will represent the days of the month, 1..28 or 1..31 or whatever. And another that will represent the boxes on the page, maybe 4, 5 or 6 rows of 7. Figure out how to leave some leading empty boxes (if necessary), put the days into the boxes, leave some trailing empty boxes at the end (if any) but omit any completely empty rows.

Those are at least three different parts to the puzzle. Try just the first one, put some code together, see what you can make work. Post it here if you want some hints going forward.
[ March 31, 2005: Message edited by: Stan James ]
 
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So what have you done so far? If you encounter problems as you are trying to solve your homework assignment, we will be glad to help. However, you have to ask specific questions about the problems you encounter. Be sure to include compiler errors, code snippets, and anything else you think might be useful in helping us understand what you tried to do and what the problem is.

Layne
 
reply
    Bookmark Topic Watch Topic
  • New Topic