Hi!
I want to pass DateTime from C# code to javascript function and use it as javascript Date object
my sample code :
How can I fix it ?
kind regard,
I want to pass DateTime from C# code to javascript function and use it as javascript Date object
my sample code :
V8ScriptEngine engine = new V8ScriptEngine();
engine.Execute("function my_func(props){ var m_date = props[\"my_date\"]; var m_code = props[\"my_code\"]; var yeay = m_date.getFullYear(); }");
PropertyBag properties = new PropertyBag();
HostFunctions hostObj = new HostFunctions();
hostObj.setProperty(properties, "my_code", 20);
hostObj.setProperty(properties, "my_date", DateTime.Now);
dynamic result = engine.Script["my_func"](properties);
An exception was thrown: TypeError: m_date.getFullYear is not a functionHow can I fix it ?
kind regard,