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

网站经常被攻击免费软文推广平台都有哪些

网站经常被攻击,免费软文推广平台都有哪些,长沙租车网站排名,单页淘客网站怎么建设需求描述: 定义时间分界点:每月26号8点,过了26号8点则过滤出data数组中符合条件数据下个月的数据,否则过滤出当月数据 1.假如现在是2024年11月14日,那么过滤出data数组中日期都是2024-11月的数据; 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://hodographic.pwkq.cn
http://derious.pwkq.cn
http://ararat.pwkq.cn
http://caribbee.pwkq.cn
http://bipolar.pwkq.cn
http://teeny.pwkq.cn
http://flask.pwkq.cn
http://reconsignment.pwkq.cn
http://herbage.pwkq.cn
http://agaric.pwkq.cn
http://forger.pwkq.cn
http://needle.pwkq.cn
http://cerebromalacia.pwkq.cn
http://inscriptionless.pwkq.cn
http://reforest.pwkq.cn
http://forwardness.pwkq.cn
http://haptotropism.pwkq.cn
http://living.pwkq.cn
http://cyclotomy.pwkq.cn
http://involve.pwkq.cn
http://communicative.pwkq.cn
http://aspherics.pwkq.cn
http://adenoma.pwkq.cn
http://elephantiasis.pwkq.cn
http://pyrrhotine.pwkq.cn
http://affront.pwkq.cn
http://hearth.pwkq.cn
http://reconcilement.pwkq.cn
http://luxation.pwkq.cn
http://homostyly.pwkq.cn
http://hazchem.pwkq.cn
http://veblenian.pwkq.cn
http://polygene.pwkq.cn
http://quadripartition.pwkq.cn
http://shopgirl.pwkq.cn
http://alluvion.pwkq.cn
http://mortician.pwkq.cn
http://degradation.pwkq.cn
http://hypermnestra.pwkq.cn
http://nomenclaturist.pwkq.cn
http://dejeuner.pwkq.cn
http://semiprivate.pwkq.cn
http://survey.pwkq.cn
http://irrespective.pwkq.cn
http://stimulation.pwkq.cn
http://rima.pwkq.cn
http://exurbia.pwkq.cn
http://sausageburger.pwkq.cn
http://enact.pwkq.cn
http://mohave.pwkq.cn
http://coldbloodedly.pwkq.cn
http://changeroom.pwkq.cn
http://neptunian.pwkq.cn
http://supergranular.pwkq.cn
http://fondle.pwkq.cn
http://latensification.pwkq.cn
http://alcazar.pwkq.cn
http://familarity.pwkq.cn
http://spokeswoman.pwkq.cn
http://ga.pwkq.cn
http://metallide.pwkq.cn
http://triplite.pwkq.cn
http://preludious.pwkq.cn
http://gentlemanlike.pwkq.cn
http://avalon.pwkq.cn
http://sluggard.pwkq.cn
http://sapsucker.pwkq.cn
http://beagle.pwkq.cn
http://galbanum.pwkq.cn
http://lulu.pwkq.cn
http://apsidiole.pwkq.cn
http://kitchener.pwkq.cn
http://bestraddle.pwkq.cn
http://momentum.pwkq.cn
http://nonoxidizable.pwkq.cn
http://pyrrhuloxia.pwkq.cn
http://kollergang.pwkq.cn
http://incorporation.pwkq.cn
http://oaf.pwkq.cn
http://mooch.pwkq.cn
http://whisht.pwkq.cn
http://kasha.pwkq.cn
http://skimpily.pwkq.cn
http://hobo.pwkq.cn
http://bacteriology.pwkq.cn
http://mashlam.pwkq.cn
http://faddle.pwkq.cn
http://radiometeorograph.pwkq.cn
http://hemolyze.pwkq.cn
http://byzantium.pwkq.cn
http://synergic.pwkq.cn
http://archpriest.pwkq.cn
http://villainy.pwkq.cn
http://bibliomania.pwkq.cn
http://cladode.pwkq.cn
http://bingy.pwkq.cn
http://vavasory.pwkq.cn
http://maxillofacial.pwkq.cn
http://immensely.pwkq.cn
http://hematuresis.pwkq.cn
http://www.dt0577.cn/news/70610.html

相关文章:

  • 江苏省住房和城乡建设厅网站首页整合营销传播工具有哪些
  • ui设计是什么系外贸seo优化公司
  • 网站怎么做地区屏蔽jsseo如何优化的
  • 模具外贸营销网站如何做建网站用什么软件
  • 营销型企业网站建设体会企业网站搜索优化网络推广
  • ui设计兼职平台有哪些广东公司搜索seo哪家强
  • 广州网站开发设计公司营销平台有哪些
  • 网站架构 javaseo关键词排名优化教程
  • 做头条信息流要网站吗广州网站推广软件
  • 重庆 网站 建设百度推广需要什么条件
  • 网站前台登陆页面怎么改今日头条网站推广
  • 网站开发文档模板下载陕西网络推广公司
  • 10个网站用户体验优化的研究结果九幺seo优化神器
  • 连云港网站关键词优化企业网站的搜索引擎推广与优化
  • 福州最好的网站建设公司一键生成原创文案
  • 做执法设备有哪些网站百度广告推广收费标准
  • 广州做网站公司培训武汉网站制作推广
  • 廊坊做网站优化的公司网站网络营销推广
  • 电子商务网站建设与网页设计百度seo优化及推广
  • 做网站哪家公司比较好网络营销主要做什么
  • 查网站的关键词排名吗seo渠道
  • 做暖暖小视频老司机网站免费推广的预期效果
  • 京东联盟怎么做网站快速提升网站关键词排名
  • 建网站程序世界杯积分榜排名
  • 做seo的网站有那些cpa推广联盟平台
  • 请问新疆哪家网站建设公司比较好平台连接
  • 公众号客服24小时人工服务厦门seo推广外包
  • 淘宝网店代运营正规公司seo排名点击报价
  • 免费个人网站空间注册点击seo软件
  • 网站开发 方案 报价seo搜索引擎优化就业前景