Wednesday, 15 April 2015

python - Flask Moment with Mustache -



python - Flask Moment with Mustache -

i trying display backend column stored utc time in local time. rendering page using mustache

in mustache below field template

<td id="cur_loc_time_{{id}}">{{current_location.last_updated_timestamp}}</td>

i trying show field locale time using flask moment in html tried below showing utc time only.

alert(moment(($("#cur_loc_time_1").text())).format('mmmm yyyy, h:mm:ss a'));

i debugging check whether displays right time 1 element. value database 2014-06-21 10:56:46 output

i tried adding in mustache template still did not work. if add together in html page

{{ moment().format('mmmm yyyy, h:mm:ss a') }}

it displays time correctly of local.

please advise if have missed anything!!

have tried add together date format explicitly:

alert(moment($("#cur_loc_time_1").text(),'yyyy-mm-dd hh:mm:ss').format('mmmm yyyy, h:mm:ss a'));

python flask mustache momentjs

No comments:

Post a Comment