This is the behavior of Javascript and it returns the month 0-11. Please
check [1] for more information.

[1] http://www.w3schools.com/jsref/jsref_getmonth.asp

Thanks
Godwin


On Fri, Jun 3, 2016 at 3:20 PM, Godwin Shrimal <[email protected]> wrote:

> Hi All,
>
> I am having a problem with getting month using script mediator, it always
> give (month - 1) value, As an example if we pass currentDate as 2015/12/31,
> it gives month as 11 not 12.
> What is the reason for this behavior ??
>
>
> <script language="js">
>   var currentDate = new Date(mc.getProperty('currentDate'));         var
> mm = currentDate.getMonth();
>     mc.setProperty("month", currentDateString);
> </script>
>
>
> Thanks
> Godwin
>
>
> --
> *Godwin Amila Shrimal*
> Senior Software Engineer
> WSO2 Inc.; http://wso2.com
> lean.enterprise.middleware
>
> mobile: *+94772264165*
> linkedin: *http://lnkd.in/KUum6D <http://lnkd.in/KUum6D>*
> twitter: https://twitter.com/godwinamila
>



-- 
*Godwin Amila Shrimal*
Senior Software Engineer
WSO2 Inc.; http://wso2.com
lean.enterprise.middleware

mobile: *+94772264165*
linkedin: *http://lnkd.in/KUum6D <http://lnkd.in/KUum6D>*
twitter: https://twitter.com/godwinamila
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to