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("圣诞节");

     个别细节不对,仅供参考

  • 相关阅读:
    cf536c——思路题
    cf536b——优先队列的运用
    王道论坛和九度论坛
    Ubuntu 12.04 LTS 下配置 apache支持SPDY, 使用wireshark 抓包分析SPDY 协议
    vnc/route/ifconfig 配置
    MIME protocol 说明
    理解邮件传输协议(SMTP、POP3、IMAP、MIME)
    GNU C中的零长度数组
    ftp protocol
    HTTP协议头部与Keep-Alive模式详解
  • 原文地址:https://www.cnblogs.com/elves/p/3586404.html
Copyright © 2011-2022 走看看