【发布时间】:2020-02-04 11:15:09
【问题描述】:
时间戳变量存储在firestore中,提取时为秒和纳秒格式,如何将时间戳转换为2018-09-19T00:00:00等格式
let Ref=firebase.firestore().collection("Recruiter").doc(u.uid).collection("Jobs")
Ref.orderBy("timestamp", "desc").onSnapshot(function(snapshot){
$.each(snapshot.docChanges(), function(){
var change= this
if(change.type==="added"){
var ab= new Date(change.doc.data().timestamp)
console.log(ab)
thisIns.RecruiterChart.chartOptions.xaxis.categories.push(
ab
)
console.log( thisIns.RecruiterChart.chartOptions.xaxis.categories)
}
})
})
变量 ab 在控制台上显示“无效日期”
【问题讨论】:
标签: javascript firebase google-cloud-firestore