简体   繁体   English

如何从c#ext.net调用javascript

[英]how can call javascript from c# ext.net

in my project when i run it in chrome it is showing wrong time. 在我的项目中,当我在chrome中运行它时显示错误的时间。 explorer it is showing true. 探险家它显示真实。 So i write this js code but it is still doesnt working. 所以我写这个js代码,但它仍然无法正常工作。 This is my js; 这是我的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 使用processDate.getFullYear()==> processDate.getFullYear().toDateString()日期数据转换为String

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

请试试这段代码

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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