In my JavaScript I want to get the previous month as 2-char-string:

Code:
datum = new Date();
var date_ = dateAdd(datum,-1,"m");
get date - 1 Month

Code:
var month2_=date2str(date_,"MM");
this doesn't work, shows me current month not month - 1

Code:
var month_="";
if (month(date_) < 10) {
    month_ = "0" + month(date_);
}
else
    month_ = "" + month(date_);
the above is a workaround that works, but its ugly

is this a bug or am i doing something wrong?