我有以下代码:
//function fires
createNewEvent = () => {
if(Boolean(this.state.newEventName)){
console.log(this.indexToDay) //logs right value of date
newEvent(
this.state.newEventName,
this.indexToDay,
this.pxToTime(this.state.initial.top),
this.pxToTime(this.state.initial.bot)
)
}
}
//firebase.js
export const newEvent = (name, date, top, bot) => {
console.log(date) //logs right value of date
const newEventRef = eventsRef.push();
newEventRef.set({
name,
date,
top,
bot,
})
}
日志中的日期如下所示:Sat Jul 07 2018 16:40:00 GMT+0200
但是在 firebase 中,只会显示名称,顶部和机器人。
为什么?
答案 0 :(得分:1)
尝试转换为字符串或时间戳。
SELECT t1.Emp_num, t1.Emp_name, t1.Swap_Date_Time AS Entry_Swipe_Time, ctbl.Exit_Swipe_Time, DATEDIFF(minute,t1.Swap_Date_Time, ctbl.Exit_Swipe_Time) AS ConsumedMinutes
FROM Sampletable t1 WITH(NOLOCK)
CROSS APPLY (
SELECT t2.Swap_Date_Time AS Exit_Swipe_Time
FROM Sampletable t2 WITH(NOLOCK)
WHERE t2.direction = 'exit' and t2.Emp_num = t1.Emp_num
) AS ctbl
WHERE t1.direction = 'entry'