惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

宝玉的分享
宝玉的分享
T
Threat Research - Cisco Blogs
H
Hacker News: Front Page
N
News and Events Feed by Topic
Know Your Adversary
Know Your Adversary
Cisco Talos Blog
Cisco Talos Blog
SecWiki News
SecWiki News
C
Cisco Blogs
D
Darknet – Hacking Tools, Hacker News & Cyber Security
T
Tor Project blog
K
Kaspersky official blog
Forbes - Security
Forbes - Security
Webroot Blog
Webroot Blog
Schneier on Security
Schneier on Security
P
Privacy & Cybersecurity Law Blog
H
Heimdal Security Blog
Y
Y Combinator Blog
The GitHub Blog
The GitHub Blog
S
SegmentFault 最新的问题
V
Vulnerabilities – Threatpost
T
Tenable Blog
T
Tailwind CSS Blog
P
Privacy International News Feed
WordPress大学
WordPress大学
大猫的无限游戏
大猫的无限游戏
小众软件
小众软件
博客园 - Franky
Hacker News: Ask HN
Hacker News: Ask HN
Jina AI
Jina AI
C
Cybersecurity and Infrastructure Security Agency CISA
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
雷峰网
雷峰网
Vercel News
Vercel News
A
About on SuperTechFans
爱范儿
爱范儿
Simon Willison's Weblog
Simon Willison's Weblog
AWS News Blog
AWS News Blog
The Last Watchdog
The Last Watchdog
Engineering at Meta
Engineering at Meta
Spread Privacy
Spread Privacy
Security Archives - TechRepublic
Security Archives - TechRepublic
博客园 - 司徒正美
量子位
博客园 - 三生石上(FineUI控件)
J
Java Code Geeks
Hacker News - Newest:
Hacker News - Newest: "LLM"
Recorded Future
Recorded Future
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Martin Fowler
Martin Fowler
Project Zero
Project Zero

博客园 - 飞鼠

面试时英语自我介绍范文 Javascript中parseInt的一個問題 NUMERIC(3,1) 的含義 在 google 里找书下载的捷径 - 飞鼠 使用asp.net发送邮件详解 創建用戶控件 - 飞鼠 - 博客园 SQL密码 不斷提醒 datagrid用xml作为数据源,并且有更新,删除和排序的操作(VB) - 飞鼠 - 博客园 将xml作为DataGrid 操作(Sort, Edit, Delete) - 飞鼠 用ASP.NET结合XML制作广告管理程序 用ASP.NET结合XML制作广告管理程序(2) - 飞鼠 - 博客园 XML、DataSet、DataGrid结合写成广告管理程序(下)(转载) - 飞鼠 - 博客园 XML、DataSet、DataGrid结合写成广告管理程序(上)(转载) 分别用DataGrid、Repeater、DataList绑定XML数据的例子 - 飞鼠 - 博客园 将某一目录下的所有相同格式的 XML文件绑定到不同的DataGrid - 飞鼠 - 博客园 创建可编辑的xml文档(之五)执行中的treeview 控件 创建可编辑的xml文档(之四) 删除、改名、插入操作 创建可编辑的xml文档(之三)执行拖放操作
判斷一天是否是年月中正確的日 - 飞鼠 - 博客园
飞鼠 · 2006-06-01 · via 博客园 - 飞鼠

//判斷一天是否是年月中正確的日
   function IsDayRight(text,columnname)
   {  
       if(document.all[text].value=="")
       {
           doFlag_errObj(text,true);
           return true;
       }
 
       if(document.all[text].value.length==1)
       {
           if(document.all[text].value=="0")
            {
               document.all[text].value ="0"
            }
            else
            {
               document.all[text].value ="0"+document.all[text].value;
            }
       }
       if(document.all['txtYYMM'].value.substring(5,7).charAt(0)=="0")
       {
           strMonth = parseInt(document.all['txtYYMM'].value.substring(5,7).replace("0",""));
       }
   
       var strText = parseInt(document.all[text].value);
       var strYear = parseInt(document.all['txtYYMM'].value.substring(0,4));
       var strMonth = parseInt(document.all['txtYYMM'].value.substring(5,7));
       if(document.all[text].value.charAt(0)=="0")
       {
           strText = parseInt(document.all[text].value.replace("0",""));
       }
       if(onblur_IsYYYYMM('txtYYMM','銷貨年月',false))
       {
           if((!check_IsNumber(document.all[text].value)) || strText<1 || strText>DaysOfMonth(strMonth,strYear) || document.all[text].value =="0")
           {
               document.all[text].focus();
                  doFlag_errObj(text,false);
                  document.all[text].select();
               alert(columnname + " 需輸入正確年月中的日!!\n");
               return false;
           }
           else
           {
               doFlag_errObj(text,true);
                  return true;
           }
       }
   }
   
   
   
   //判斷閏年
   function IsLeap(year)     
   {
       if((year%4==0 && year%100!=0) || (year%400==0))
       {
           return true;
       }
       else
       {  
           return false;
       }
            }
            //判斷一年中一個月又多少天
            function DaysOfMonth(month,year)
            {
                switch(month)
                {
                case 1:
                case 3:
                case 5:
                case 7:
                case 8:
                case 10:
                case 12:
                    return 31;
                case 2:
                    if(IsLeap(year))
                        return 29;
                    else
                        return 28;
                default:
                    return 30;
                }
            }

使用方法:onblur="IsDayRight('txtDAY3','第三週日止(含)')"
代碼寫的好濫