【问题标题】:JQuery: Comparing date entered in textbox against today's date [duplicate]JQuery:将文本框中输入的日期与今天的日期进行比较[重复]
【发布时间】:2013-05-15 16:31:08
【问题描述】:

如何检查文本框中输入的日期是否大于今天的日期?从文本框中检索的格式,例如2013 年 14 月 5 日

【问题讨论】:

  • 将该日期格式化为可被new Date("date string")解析,然后与>对比new Date()
  • 你试过了吗?

标签: javascript jquery


【解决方案1】:
var entered_date = $("#txtBox1").val();    
var today = new Date();
if(entered_date>today)
{
   //...
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-03-12
    • 2020-04-13
    • 1970-01-01
    • 2014-11-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多