.NET Dates and JSON
.NET Dates and JSON
我想使用这个要点来覆盖JQuery的parseJSON,以考虑.NET的日期。
问题是它不能替换这种格式的日期:
"ReviewDate":"'/Date(1404946800000+0100)'/"
这个正则表达式似乎没有考虑时区:
var replaceNet = /"'''/Date'(('d+)(?:-'d+)?')'''/"/i;
其他人能建议我如何解决这个问题吗?
您可以使用以下函数作为格式化程序:
function date(s) { return new Date(parseFloat(/Date'(([^)]+)')/.exec(s)[1])); }
希望能有所帮助。
相关文章:
- Ajax and Json with Rails
- JSON and jQuery Search
- JSON and javascript objects
- Remote json and Javascript
- JSON and javascript
- JSON and AJAX response
- JSON and Highcharts
- JSON and Angularjs
- Pupulate Dom HTML fom JSON and coffeescript
- JSON and AJAX with Python
- Securing JSON and ASP.NET MVC2
- Working with JSON and Angular NVD3
- json and null values
- Parsererror with json and PHP
- RIA Services JSON and Ext.Js
- JSON and Python
- Laravel 3 JSON and jQuery getJSON
- json and javascript issue
- JSON and Angular
- flickr api, json and set list