简体   繁体   中英

how can call javascript from c# ext.net

in my project when i run it in chrome it is showing wrong time. explorer it is showing true. So i write this js code but it is still doesnt working. This is my js;

  var FormatTrxStartDate = function (value, record) { var processDate = new Date(value); return processDate.getDate() + "." + (processDate.getMonth() + 1) + "." + processDate.getFullYear() + " " + processDate.getHours() + ":" + processDate.getMinutes() + ":" + processDate.getSeconds(); }; 

And this is where i use it;

<ext:ModelField Name="TrxStartDate" Type="String" >
<Convert Fn='FormatTrxStartDate' />
</ext:ModelField>

Pass Parameter Value in not proper Date Format

Use processDate.getFullYear()==> processDate.getFullYear().toDateString() date data convert into String

X.Js.Call("FormatTrxStartDate ",value,record);

请试试这段代码

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM