console
moment.locale('zh-cn');
let arr = [
{
Diarys: [
{
content: '',
Time: '2019-08-09 09:20:00'
}
]
}
]
function toDouble(n) {
return n < 10 ? '0' + n : '' + n;
}
arr.forEach(item => {
item.Diarys.forEach(it => {
let formatTime = moment(it.Time).format('MMMM Do YYYY, h:mm:ss a');
it.diyMonth = formatTime.split(' ')[0]
it.diyDate = toDouble(new Date(it.Time).getDate());
it.diyTime = it.Time.split(' ')[1].split(':')[0] + ':' + it.Time.split(' ')[1].split(':')[1]
})
})
<script src="http://momentjs.cn/downloads/moment-with-locales.js"></script>