Javascript 第页提供了“";时间“;功能

Javascript 第页提供了“";时间“;功能,javascript,function,react-native,Javascript,Function,React Native,我想让“分贝”页面只在一天的比赛和3小时内可用(例如比赛在晚上20点开始,该页面可能在19小时到22小时之间可用) 我发现如何做到这一点只有日期,而不是时间 OpenDecibels = () => { return this.state.sport.clubs.map((element) => { if (element.dateMatch === Date.now()) { console.log(element.DateMatch);

我想让“分贝”页面只在一天的比赛和3小时内可用(例如比赛在晚上20点开始,该页面可能在19小时到22小时之间可用)

我发现如何做到这一点只有日期,而不是时间

OpenDecibels = () => {
    return this.state.sport.clubs.map((element) => {
      if (element.dateMatch === Date.now()) {
        console.log(element.DateMatch);
        return (
          <Button
            title="Decibels "
            color="#841584"
            accessibilityLabel="Learn more about this purple button"
          />
        );
      } else {
        return (
          <Button
            title="Decibels non disponible"
            color="#841584"
            accessibilityLabel="Learn more about this purple button"
          />
        );
      }
    });
  };
OpenDecibels=()=>{
返回此.state.sport.clubs.map((元素)=>{
if(element.dateMatch==Date.now()){
console.log(element.DateMatch);
返回(
);
}否则{
返回(
);
}
});
};

如果有人有解决办法:D提前谢谢你

您的
元素
是否有可用小时数的开始和停止时间?或者你有没有其他方法知道什么时候该去俱乐部。