Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 16,676
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: get day of week for the selected date

Reviewing the API would have kept this thread to a single page :smileyhappy:
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Super Contributor
Posts: 425
Registered: ‎01-02-2013
My Device: BOLD 9900
My Carrier: sdvsdvsd

Re: get day of week for the selected date

ok on 20/05/2013, it's thursday - as you said Month 5 is June,
but it's showing me 5 in console and 5 means friday
Developer
Posts: 19,628
Registered: ‎07-14-2008
My Device: Not Specified

Re: get day of week for the selected date

Copied from the Constants Value in the API:

 

public static final int THURSDAY 5
Super Contributor
Posts: 425
Registered: ‎01-02-2013
My Device: BOLD 9900
My Carrier: sdvsdvsd

Re: get day of week for the selected date

can u provide the link to API
Developer
Posts: 19,628
Registered: ‎07-14-2008
My Device: Not Specified

Re: get day of week for the selected date

[ Edited ]

"can u provide the link to API"

 

I am surprised by this question because:

1) How have you been researching your code, if you don't have the API documentation?

2) If you have not got that link, then why did you say that Day 5 was Friday?  Was that just a guess?

 

I recommend that you review all the pages you can get to from here:

http://developer.blackberry.com/java/

 

You will notice in the 'header' area, there is link to the API Reference:

click on that and you can find the documentation for the Calendar class;

click on that, you will find references to the static values it uses, including DAY_OF_WEEK;

click on one of these, you will get a little more detail, including a link to the Constant Field Values;

click on the Constant FIeld Values link to find out what these actually are.

 

I hope we have now solved this Thread. 

 

 

 

Super Contributor
Posts: 425
Registered: ‎01-02-2013
My Device: BOLD 9900
My Carrier: sdvsdvsd

Re: get day of week for the selected date

ok , today is 22/05/2013, so June is 5th month so to find todays day we have to write 04

and i got ----DAY_OF_WEEK-------4 in console and today is wednesday.can plz can u provide me the link to the API which have contants values for days

 

Calendar rightNow2 = Calendar.getInstance();
rightNow2.set(Calendar.YEAR, 2013);
rightNow2.set(Calendar.MONTH, 04);
rightNow2.set(Calendar.DAY_OF_MONTH, 22);
System.out.println("----DAY_OF_WEEK-------"+rightNow2.get(Calendar.DAY_OF_WEEK ));

Developer
Posts: 19,628
Registered: ‎07-14-2008
My Device: Not Specified

Re: get day of week for the selected date

Above?