$(document).ready(function(){
$('.local_time').text(moment.utc($('.local_time').text()).local().format('YYYY-MM-DD HH:mm:ss'));
});
$(document).ajaxComplete(function(){
$('.local_time').text(moment.utc($('.local_time').text()).local().format('YYYY-MM-DD HH:mm:ss'));
});
<span class='local_time'><%= order_item.shippings.first.try(:updated_at) %></span>
moment.js实现客户端显示本地时间
最新推荐文章于 2023-07-12 12:12:14 发布