I have been using local_time to convert servertime to client local time. However now I am using datatables and to sort date/time
columns. I have to use date-moment.js
plugin of Datatables
which uses moment.js to handle date conversions.
My problem is: the local_time
's view helper is wrapping the date with < time >
tag like this
<time data-format="%B %e, %Y %l:%M%P"
data-local="time"
datetime="2013-11-27T23:43:22Z"
title="November 27, 2013 6:43pm EDT"
data-localized="true">November 27, 2013 6:43pm</time>
The wrapping thing is creating problem for moment.js
to get the actual date-time
as it expects. I need it to convert the date-time but not wrap with <time>
tag. Is it possible. If yes How?
currently created a helper method to extract the core date from the string returned by the gem's
local_date
methodin
views/
<%= extract_date(local_date(workflow.created_at, CommonConstants::DATE_FORMAT_LONG)) %>