【发布时间】:2025-12-08 01:15:01
【问题描述】:
我正在处理时间循环。
var startShow = [];
var endShow = [];
for(var i = 0; i < jsonStr[4].length; i < i++)
{
startShow[i] = moment(jsonStr[4][i].start_show).format('MM/DD/YYYY HH:mm:ss');
//ex: 01/12/2021 18:32:40,01/12/2021 17:32:40,01/12/2021 16:52:40,01/12/2021 18:10:40
endShow[i] = moment(jsonStr[4][i].end_show).format('MM/DD/YYYY HH:mm:ss');
//ex: 01/12/2021 18:53:55,01/12/2021 18:23:40,01/12/2021 19:32:40,01/12/2021 19:50:40
}
现在我有了这个 FlipClock 插件,
var theCounters = $('.clock .value').FlipClock({
clockFace: 'TwentyFourHourClock',
callbacks:
{
interval:function()
{
var time = this.factory.getTime().time;
var currentTime = (moment(time).format('MM/DD/YYYY HH:mm:ss'));
//Here I need the currentTime check if there is a time between startShow and endShow matched.
if(matched)
{
alert("matched");
}
else
{
alert("not matched");
}
}
}
});
我的问题,是否可以检查 startShow 和 endShow 之间的 currentTime 是否与我上面的代码匹配?
【问题讨论】:
标签: javascript flipclock