Tuesday 21 January 2014

.format method in javascript

I was having a problem with date format method in javascript.

My friend suggest me to put below code on the page

<asp:ScriptManager ID="ScriptManager1" runat="server" AsyncPostBackTimeout="360000"
        EnablePageMethods="true" EnablePartialRendering="true">

and it worked.

Just put scriptManager on page and .format method will work.

var dt = new Date($("#txtinDateShow").val());
dt = dt.format("yyyy/MM/dd");

Hope this will helpful to you.
Happy scripting...

No comments:

Post a Comment