My97DatePicker是用JS封装的一个开源的日期控件。它可以单独的显示日期,星期,带时间的日期等等。深受广大IT员儿们的青睐。最近做的一个项目中,需要用到日期查询的条件,但是我觉得VS自带的Calendar控件太丑了。。我就baidu了一下,发现了My97DatePicker这个控件。
IE 6.0+ , Firefox 2.0+ , Chrome, Opera 9.5+ , Safari 3.0+
1.下载地址:http://www.jb51.net/jiaoben/18012.html
2.引入到你的项目中
3.要整个文件夹都引入,My97DatePicker目录是一个整体,不可破坏里面的目录结构,也不可对里面的文件改名,可以改目录名My97DatePicker.htm是必须文件,不可删除
<span style="font-family:KaiTi_GB2312;">根据日期查看我的订单:<input runat="server" id="theday" value="<%#mydate%>" class="Wdate" onfocus="WdatePicker({lang:'zh-cn',maxDate:new Date(),readOnly:true})" /></span>
<span style="font-family:KaiTi_GB2312;">public string mydate; protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { mydate = DateTime.Now.ToString("yyyy-MM-dd"); Page.DataBind(); //TODO:假数据 //Label1.Text = "程序员" + ",您好 "; Label1.Text = Session["Username"].ToString() + ",您好 "; BindOrder(); }</span>
<span style="font-family:KaiTi_GB2312;">private void BindOrder() { DataTable dt = new DataTable(); string ordertime = this.theday.Value; //TODO:假数据 //string cardno = "E000196"; string cardno = Session["Admin"].ToString(); dt = new SelectFood().SelectOrderBytime(ordertime,cardno);// anp.RecordCount = dt.Rows.Count; //记录总数 int startIndex = anp.StartRecordIndex; //开始记录数 int endIndex = anp.EndRecordIndex; //结束记录数 this.GridView1.DataSource = new SelectFood().SelectorderByPage(startIndex, endIndex, ordertime, cardno); this.GridView1.DataBind(); }</span>
<span style="font-family:KaiTi_GB2312;"><input type="text" id="abc" onfocus="WdatePicker({dateFmt:'yyyy年MM月dd日 HH时mm分ss秒'})" class="Wdate" style="width:300px"/></span>
<span style="font-family:KaiTi_GB2312;"><input type="text" id="abc" onfocus="WdatePicker({skin:'whyGreen',dateFmt:'H:mm:ss'})" class="Wdate"/></span>
<span style="font-family:KaiTi_GB2312;"><input id="d244" type="text" class="Wdate" onfocus="WdatePicker({dateFmt:'yyyy年M月d日',vel:'d244_2'})"/> <input id="d244_2" type="text" /></span>
<span style="font-family:KaiTi_GB2312;"><input class="Wdate" type="text" onfocus="WdatePicker({doubleCalendar:true,dateFmt:'yyyy-MM-dd'})"/></span>