【发布时间】:2016-02-12 02:34:18
【问题描述】:
鉴于开始时间/日期和持续时间,我如何进行服务器端计算来确定对象是"finished"、"in progress" 还是"upcoming"
--Show
--duration: "144"
--startDate: "2015-11-10"
--startTime: "14:00"
--status: "?"
客户端 javascript 来确定节目是否已经开始:
// if negative, then show hasn't started yet
var time = (-(startdate.getTime() - currentdate.getTime()) / 1000 / 60);
客户端 javascript 来确定节目是否已经结束运行:
// if negative, then show has finished
var timeLeft = channelDuration - timerStartTime;
【问题讨论】:
标签: javascript firebase