MVCでAngularJSを利用してアプリケーション作成中、
DateTime型のデータ出力でつまづいたのでメモ
【Sample.cshtml】
{{sample.Date}}
/Date(1457058672120)/
{{sample.Date | date:'yyyy/MM/dd HH:mm'}}
/Date(1457058672120)/
{{sample.Date.substring(6,sample.Date.length-2) | date:'yyyy/MM//dd HH:mm'}}
2016/03/04 11:31
JSONでのDatetimeのやりとり
/Date(ticks)/ の形式にシリアライズされていしまう。
※ticks = 1970/1/1からのミリ秒
date:'yyyy/MM//dd HH:mm'
date型に整形してくれるフィルター
str.substring(indexA[,indexB])
var str = "SampleText";
str.substring(0,3); //=Sam
str.substring(3,5)/ //=plete
str.subsring(6,str.length); //=Text
※C#の String.Substring(int startIndex, int length)とは違うので注意!!
https://msdn.microsoft.com/ja-jp/library/aka44szs(v=vs.110).aspx