Not a bug DateTime not parse after insert element

truonglv

Well-known member
Hi. This is more steps but i will give it now.

In php i return an HTML date by call like this.

PHP:
$datetimeHtml = XenForo_Template_Helper_Core::dateTime(
    XenForo_Application::$time, 'html'
);

return json_encode('datetimeHtml' => $datetimeHtml);

Then in js I have do this.

PHP:
$(ajaxData.datetimeHtml).xfInsert('appendTo', $container);

The result show full time. Eg: Aug 27, 2015 at 6:55 PM. It should show A few seconds.
 
Activation of the JS handlers, including the timestamp handler, is based on descendants of the element(s) being inserted. If you're inserting that directly, you'll need to activate it manually (likely via the parent).
 
Back
Top Bottom