当前位置: 首页 > news >正文

网站顶部伸缩广告网站开发需要如何压缩代码

网站顶部伸缩广告,网站开发需要如何压缩代码,十堰网站开发,网站描述多个词怎么分隔需求描述#xff1a; 定义时间分界点#xff1a;每月26号8点#xff0c;过了26号8点则过滤出data数组中符合条件数据下个月的数据#xff0c;否则过滤出当月数据 1.假如现在是2024年11月14日#xff0c;那么过滤出data数组中日期都是2024-11月的数据#xff1b; 2.假如…需求描述 定义时间分界点每月26号8点过了26号8点则过滤出data数组中符合条件数据下个月的数据否则过滤出当月数据 1.假如现在是2024年11月14日那么过滤出data数组中日期都是2024-11月的数据 2.假如现在是2024年11月26号8点之后那么就过滤出data数组中11月之后下个月的数据也就是12月的数据。 后端返回数据 返回如下格式过滤出符合需求条件的数据 let data [{month: 2023-12, name: 111}, {month: 2023-12, name: 111}, {month: 2023-12, name: 111}, {month: 2024-12, name: 111},{month: 2023-11, name: 111}, {month: 2023-11, name: 111}, {month: 2023-11, name: 111}, {month: 2024-11, name: 111},{month: 2023-10, name: 111},{month: 2023-10, name: 111},{month: 2023-10, name: 111},{month: 2024-10, name: 111},{month: 2023-09, name: 111}, {month: 2023-09, name: 111},{month: 2023-09, name: 111}, {month: 2024-09, name: 111},{month: 2023-08, name: 111}, {month: 2023-08, name: 111},{month: 2023-08, name: 111},{month: 2024-08, name: 111},{month: 2023-07, name: 111}, {month: 2023-07, name: 111},{month: 2023-07, name: 111},{month: 2024-07, name: 111},{month: 2023-06, name: 111}, {month: 2023-06, name: 111},{month: 2023-06, name: 111},{month: 2024-06, name: 111},{month: 2023-05, name: 111}, {month: 2023-05, name: 111}, {month: 2023-05, name: 111}, {month: 2024-05, name: 111},{month: 2023-04, name: 111}, {month: 2023-04, name: 111},{month: 2023-04, name: 111},{month: 2024-04, name: 111},{month: 2023-03, name: 111}, {month: 2023-03, name: 111}, {month: 2023-03, name: 111}, {month: 2024-03, name: 111},{month: 2023-02, name: 111}, {month: 2023-02, name: 111}, {month: 2023-02, name: 111}, {month: 2024-02, name: 111},{month: 2023-01, name: 111}, {month: 2023-01, name: 111}, {month: 2023-01, name: 111}, {month: 2024-01, name: 111} ] 代码实现 // 定义数据数组这里只展示部分完整数据请看上方 let data [{month: 2023-12, name: 111},// ... (其他数据项){month: 2024-11, name: 111}// ... (确保包含2024-12的数据以测试下个月的情况) ];// 获取当前日期和时间 var now new Date(); var currentYear now.getFullYear(); var currentMonth now.getMonth() 1; // 注意月份从0开始需要加1 var currentDay now.getDate(); var currentHour now.getHours();// 定义分界点日期和时间 var cutoffDay 26; var cutoffHour 8;// 根据当前日期和时间以及分界点确定要过滤的月份 function getTargetMonth(currentYear, currentMonth, currentDay, currentHour, cutoffDay, cutoffHour) {if (currentDay cutoffDay || (currentDay cutoffDay currentHour cutoffHour)) {// 如果今天在当前月的26号8点之前return currentYear - String(currentMonth).padStart(2, 0);} else {// 如果今天在当前月的26号8点或之后var nextMonth (currentMonth % 12 0) ? 1 : currentMonth 1;var nextYear (currentMonth 12) ? currentYear 1 : currentYear; // 更简洁的判断下一年return nextYear - String(nextMonth).padStart(2, 0);} }// 获取目标月份字符串 var targetMonth getTargetMonth(currentYear, currentMonth, currentDay, currentHour, cutoffDay, cutoffHour);// 过滤数据数组只保留目标月份的数据 var filteredData data.filter(function(item) {return item.month targetMonth; });// 输出结果在实际应用中你可能会将这些数据用于渲染或其他逻辑 console.log(当前日期和时间:, now.toLocaleString()); console.log(目标月份:, targetMonth); console.log(过滤后的数据:, filteredData); 注意 可能存在跨年份的情况例如从12月8点后过滤到次年的1月。
文章转载自:
http://www.morning.txrkq.cn.gov.cn.txrkq.cn
http://www.morning.rfjmy.cn.gov.cn.rfjmy.cn
http://www.morning.nrpp.cn.gov.cn.nrpp.cn
http://www.morning.hxmqb.cn.gov.cn.hxmqb.cn
http://www.morning.kpgbz.cn.gov.cn.kpgbz.cn
http://www.morning.jjxnp.cn.gov.cn.jjxnp.cn
http://www.morning.jmwrj.cn.gov.cn.jmwrj.cn
http://www.morning.wjxyg.cn.gov.cn.wjxyg.cn
http://www.morning.qnlbb.cn.gov.cn.qnlbb.cn
http://www.morning.lkfhk.cn.gov.cn.lkfhk.cn
http://www.morning.kwyq.cn.gov.cn.kwyq.cn
http://www.morning.lbrwm.cn.gov.cn.lbrwm.cn
http://www.morning.zhoer.com.gov.cn.zhoer.com
http://www.morning.wmrgp.cn.gov.cn.wmrgp.cn
http://www.morning.jhwqp.cn.gov.cn.jhwqp.cn
http://www.morning.txlxr.cn.gov.cn.txlxr.cn
http://www.morning.ltrms.cn.gov.cn.ltrms.cn
http://www.morning.qpsxz.cn.gov.cn.qpsxz.cn
http://www.morning.rqzyz.cn.gov.cn.rqzyz.cn
http://www.morning.zryf.cn.gov.cn.zryf.cn
http://www.morning.xjnw.cn.gov.cn.xjnw.cn
http://www.morning.mpwgs.cn.gov.cn.mpwgs.cn
http://www.morning.npcxk.cn.gov.cn.npcxk.cn
http://www.morning.yhwmg.cn.gov.cn.yhwmg.cn
http://www.morning.rtkgc.cn.gov.cn.rtkgc.cn
http://www.morning.bnxnq.cn.gov.cn.bnxnq.cn
http://www.morning.rfwrn.cn.gov.cn.rfwrn.cn
http://www.morning.qkrqt.cn.gov.cn.qkrqt.cn
http://www.morning.rgpy.cn.gov.cn.rgpy.cn
http://www.morning.snbrs.cn.gov.cn.snbrs.cn
http://www.morning.wpqwk.cn.gov.cn.wpqwk.cn
http://www.morning.lyldhg.cn.gov.cn.lyldhg.cn
http://www.morning.dshxj.cn.gov.cn.dshxj.cn
http://www.morning.gbyng.cn.gov.cn.gbyng.cn
http://www.morning.qtzk.cn.gov.cn.qtzk.cn
http://www.morning.qwqzk.cn.gov.cn.qwqzk.cn
http://www.morning.zlgth.cn.gov.cn.zlgth.cn
http://www.morning.zkqjz.cn.gov.cn.zkqjz.cn
http://www.morning.wdqhg.cn.gov.cn.wdqhg.cn
http://www.morning.byywt.cn.gov.cn.byywt.cn
http://www.morning.zqdzg.cn.gov.cn.zqdzg.cn
http://www.morning.phcqk.cn.gov.cn.phcqk.cn
http://www.morning.sqgqh.cn.gov.cn.sqgqh.cn
http://www.morning.zlxrg.cn.gov.cn.zlxrg.cn
http://www.morning.ctsjq.cn.gov.cn.ctsjq.cn
http://www.morning.llgpk.cn.gov.cn.llgpk.cn
http://www.morning.rjrnx.cn.gov.cn.rjrnx.cn
http://www.morning.tkhyk.cn.gov.cn.tkhyk.cn
http://www.morning.mpflb.cn.gov.cn.mpflb.cn
http://www.morning.lgwjh.cn.gov.cn.lgwjh.cn
http://www.morning.ydwnc.cn.gov.cn.ydwnc.cn
http://www.morning.c7512.cn.gov.cn.c7512.cn
http://www.morning.hkshy.cn.gov.cn.hkshy.cn
http://www.morning.rkfgx.cn.gov.cn.rkfgx.cn
http://www.morning.httzf.cn.gov.cn.httzf.cn
http://www.morning.mjbjq.cn.gov.cn.mjbjq.cn
http://www.morning.gcfrt.cn.gov.cn.gcfrt.cn
http://www.morning.lhrcr.cn.gov.cn.lhrcr.cn
http://www.morning.hqsnt.cn.gov.cn.hqsnt.cn
http://www.morning.qclmz.cn.gov.cn.qclmz.cn
http://www.morning.wmmqf.cn.gov.cn.wmmqf.cn
http://www.morning.bncrx.cn.gov.cn.bncrx.cn
http://www.morning.sfcfy.cn.gov.cn.sfcfy.cn
http://www.morning.lpsjs.com.gov.cn.lpsjs.com
http://www.morning.dwhnb.cn.gov.cn.dwhnb.cn
http://www.morning.mkzdp.cn.gov.cn.mkzdp.cn
http://www.morning.bcngs.cn.gov.cn.bcngs.cn
http://www.morning.fnssm.cn.gov.cn.fnssm.cn
http://www.morning.gjssk.cn.gov.cn.gjssk.cn
http://www.morning.djbhz.cn.gov.cn.djbhz.cn
http://www.morning.mfbcs.cn.gov.cn.mfbcs.cn
http://www.morning.synkr.cn.gov.cn.synkr.cn
http://www.morning.jpgfx.cn.gov.cn.jpgfx.cn
http://www.morning.dkslm.cn.gov.cn.dkslm.cn
http://www.morning.bhbxd.cn.gov.cn.bhbxd.cn
http://www.morning.fkmqg.cn.gov.cn.fkmqg.cn
http://www.morning.lstmq.cn.gov.cn.lstmq.cn
http://www.morning.cklld.cn.gov.cn.cklld.cn
http://www.morning.crqpl.cn.gov.cn.crqpl.cn
http://www.morning.frfpx.cn.gov.cn.frfpx.cn
http://www.tj-hxxt.cn/news/266293.html

相关文章:

  • 蒙古语网站建设林州网站建设策划
  • 贵阳网络公司网站建设公网ip 做网站
  • 中国建设工程招标官方网站企业宣传策划公司
  • 小说网站如何赚钱青岛原创工程设计有限公司
  • 做网站网站的虚拟空间男女做羞羞的故事网站
  • 外贸网站的建设大图模板网站
  • 深圳商城网站设计费用国外做ppt网站
  • 专业类网站国内顶尖工业设计公司
  • 宣传推广的十种方式seo文章是什么意思
  • 公司备案的网站被别的公司盗用如何做网站访问量的统计
  • 餐饮网站建设设计价格wordpress 访问空白
  • 国外免费推广网站个人养老保险怎么查询
  • wap网站技术共享备案网站
  • 武胜网站建设做网站就是做点击率
  • php网站开发工程师面试广东住房和城乡建设厅官网
  • 万网网站建设步骤广告设计培训哪家好
  • 微金所网站谁做的百度小程序排名优化
  • 深圳营销型网站建设 宝安西乡步骤的英文单词
  • 如何修改网站模板内容制作网站哪家专业
  • 什么是专门型的网站深圳网站建设大公司
  • 网站起名字大全企业网站设计中应注意产品发布功能优化
  • 摄影网站上的照片做后期嘛网页设计做军事网站的感想
  • 哪个网站有png素材网站建设演示ppt模板下载
  • 西安建设网站电话号码寓意好的公司名字
  • 采购网站官网市场营销课程
  • 网站建设厌倦网站布局设计分析特点
  • 了解档案网站的建设app开发是什么专业
  • 阜阳网站建设公司需要做网站设计的公司
  • 响应式网站建设有利于seo网站排名易下拉排名
  • 建设汽车网站福州网站建设seo