我刚刚开始使用jQuery 模板作为我的 javascript 模板引擎。我的问题是,我如何格式化日期(从 ASP.NET Json ActionResult 返回)格式为:
/Date(1288709830000)/
我尝试执行以下操作:
{{= $.format(new Date(parseInt(comment.DateCreated.substr(6))), 'd')}}
注意上面使用了新的jquery全球化插件来添加$.format
方法。另请注意,这{{= comment.DateCreated }}
是长手的说法${comment.DateCreated}
。
如果您能提供帮助,我将不胜感激。