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

     个别细节不对,仅供参考

  • 相关阅读:
    HDU1029 Ignatius and the Princess IV
    UVA11039 Building designing【排序】
    UVA11039 Building designing【排序】
    POJ3278 HDU2717 Catch That Cow
    POJ3278 HDU2717 Catch That Cow
    POJ1338 Ugly Numbers(解法二)
    POJ1338 Ugly Numbers(解法二)
    UVA532 Dungeon Master
    UVA532 Dungeon Master
    POJ1915 Knight Moves
  • 原文地址:https://www.cnblogs.com/elves/p/3586404.html
Copyright © 2011-2022 走看看