java script standard code to return no of days in a given month -March 2013 fails to return 31 days..

I am using GWT 2.0 Calender panel, which compiles in to javascript and html. Calender panel fails to return march 31st.

Can you please share your taughts/suggestions on the same, and work around for this issue.