zoukankan      html  css  js  c++  java
  • js 判断所有节假日

    // JavaScript Document
    
    
    
    calendar = new Date();
    month = calendar.getMonth();
    date = calendar.getDate();
    
    if ((month == 0) && (date == 1)) document.write("元旦");
    if ((month == 1) && (date ==13 )) document.write("除夕");
    if ((month == 1) && (date ==14 )) document.write("春节/情人节");
    if ((month == 2) && (date == 1)) document.write("国际海豹日");
    if ((month == 2) && (date == 8)) document.write("国际劳动妇女节/中国保护母亲河日");
    if ((month == 2) && (date == 12)) document.write("植树节");
    
    if ((month == 3) && (date == 1)) document.write("愚人节");
    if ((month == 3) && (date == 5)) document.write("清明节");
    if ((month == 4) && (date == 1)) document.write("国际劳动节");
    if ((month == 4) && (date == 9)) document.write("母亲节");
    
    if ((month == 5) && (date == 1)) document.write("国际儿童节");
    if ((month == 5) && (date == 26)) document.write("国际禁毒日");
    
    if ((month == 7) && (date == 1)) document.write("建军节");
    if ((month == 7) && (date == 15)) document.write("日本无条件投降日/世纪婚纱日");
    if ((month == 7) && (date == 16)) document.write("七夕情人节");
    
    
    if ((month == 9) && (date == 20)) document.write("世界厨师日");
    if ((month == 9) && (date == 22)) document.write("世界传统医药日");
    if ((month == 9) && (date == 24)) document.write("联合国日/世界发展信息日");
    if ((month == 9) && (date == 25)) document.write("世界骨质疏松日/抗美援朝纪念日/环卫工人节");
    if ((month == 9) && (date == 31)) document.write("世界勤俭日/中国男性健康日");
    
    if ((month == 11) && (date == 24)) document.write("平安夜"); 
    if ((month == 11) && (date == 25)) document.write("圣诞节");

     个别细节不对,仅供参考

  • 相关阅读:
    loadrunner监控linux之linux下安装rpc
    Linux中top命令参数详解
    使用jmeter监控服务器性能指标
    jmeter连接mysql数据库配置
    loadrunner--设置代理录制
    页面下载时间细分图组成
    linux网络配置
    科学把妹法
    简单而强大的bitset
    名言札记
  • 原文地址:https://www.cnblogs.com/elves/p/3586404.html
Copyright © 2011-2022 走看看