I'm using a calendar from jQueryUI datepicker.
For a some reason I would like to know, how to change a
data-month='" + printDate.getMonth() + "'
to show current month with a leading zero, if it has it.
We may see this code (as a ready HTML) at a calendar's row:
<td class=" " data-handler="selectDay" data-event="click" data-month="8" data-year="2013">
<a class="ui-state-default" href="#">13</a>
</td>
So, now it is a September, so it should shows a '09' instead of '8'
To make it '9' I did + (printDate.getMonth()+1) +
But I have no idea how to make it with a ZERO.
It should be something like
if(printDate.getMonth() < 10){printDate.getMonth() = '0'+printDate.getMonth()}
But this code does not work, I'm sure I did something wrong with it.
Uncaught ReferenceError: Invalid left-hand side in assignment
Thanks!