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

     个别细节不对,仅供参考

  • 相关阅读:
    css gridlayout
    css position 属性
    简单的登陆界面
    introduce
    Event flow
    constructor和object的区别
    10th week (1)
    编程语言的历史和发展
    正则表达式的验证匹配
    js正则替换
  • 原文地址:https://www.cnblogs.com/elves/p/3586404.html
Copyright © 2011-2022 走看看