File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Working with Calendar class

 
Aman Singh
Ranch Hand
Posts: 57
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Experts,
I have the following code where I am creating a table on a jsp page. First Column of the table is "Application" and after that 12 months.
My problem is that, First month is coming up as April, Where as I want to start from july as first month and last month as June.
Can somone please tell me where do I need to do modification in my current code.

 
Brian Legg
Ranch Hand
Posts: 488
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, I'm not 100% sure here but doesn't the following code just return today's date 12 times. This month is April so that's why you are getting April. If you always want to start with June then why even get the current date? Just get a Date object with the month of June or turn your current date's month to June. The month is an int and you know how to roll it so the rest should be easy



HTH
 
Aman Singh
Ranch Hand
Posts: 57
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Brian,
Thanks for your quick reply. Actually you are correct with the return of 12 dates, but later on I am formatting it in month.
what I am trying to achieve is:
* maintain the headers Dynamic is way that, Lets say July is first month and June is last in the table.
so when we move on to May 2009, August would be the first month and July as last.

I hope I explained it correct :-(
 
Balu Sadhasivam
Ranch Hand
Posts: 874
Android Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aman Singh wrote:Hi Brian,
Thanks for your quick reply. Actually you are correct with the return of 12 dates, but later on I am formatting it in month.
what I am trying to achieve is:
* maintain the headers Dynamic is way that, Lets say July is first month and June is last in the table.
so when we move on to May 2009, August would be the first month and July as last.

I hope I explained it correct :-(



Whats the logic behind that , current month + 3 ? then implement that using Calendar set() method
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic