最好的日期选择插件jedate完整示例

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" type="text/css" href="/application/views/static/bootstrap-3.3.7-dist/css/bootstrap.min.css">
  <script type="text/javascript" src="/application/views/static/bootstrap-3.3.7-dist/js/jquery-3.2.1.min.js"></script>
  <link rel="stylesheet" type="text/css" href="/application/views/static/jedate/skin/jedate.css">
  <script type="text/javascript" src="/application/views/static/jedate/jquery.jedate.min.js"></script>

  <style type="text/css">
    .wrap{
    width: 350px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    }
  </style>

  <script type="text/javascript">

  $(document).ready(function(){
    $("#download").click(function(){
        console.log($("form").serialize());
              window.open('http://dwq.xxx.com/OutPutExcel/outExcel/?'+$("form").serialize(), '下载文件');
          })
      });

  $(function() {
              $("#time_picker_start").jeDate({
                  format: "YYYY-MM-DD hh:mm:ss",
                  isTime: true,
                  // festival:true,
                  isinitVal:true,
                  initAddVal:{DD:"-3"},
                  minDate: "2014-09-19 00:00:00"
              })
          })

  $(function() {
              $("#time_picker_end").jeDate({
                  format: "YYYY-MM-DD hh:mm:ss",
                  isTime: true,
                  // festival:true,
                  isinitVal:true,
                  minDate: "2014-09-19 00:00:00"
              })
          })
  </script>
</head>
<body>
  <div class="container" style="margin-top: 30px;">
    <form class="form-horizontal" action="" method="get" role="form">
      <div class="form-group">
          <label for="weixin_url" class="col-xs-4 col-sm-2 control-label">模糊搜索</label>
          <div class="col-xs-8 col-sm-9">
              <input type="text" class="form-control" autofocus="true" name="search" id="weixin_url" value="<?php echo $list['search']; ?>" placeholder="输入地址或者备注即可搜索">
          </div>
      </div>
      <div class="form-group">
        <label for="class_selecte" class="col-xs-4 col-sm-2 control-label">起始时间</label>
        <div class="col-xs-8 col-sm-9">
        <input type="text"  class="form-control" name="start_time" id="time_picker_start">
        </div>
      </div>
      <div class="form-group">
        <label for="class_selecte" class="col-xs-4 col-sm-2 control-label">终止时间</label>
        <div class="col-xs-8 col-sm-9">
        <input type="text"  class="form-control" name="end_time" id="time_picker_end">
        </div>
      </div>

      <div class="form-group">
        <label for="class_selecte" class="col-xs-4 col-sm-2 control-label">导出条数</label>
        <div class="col-xs-8 col-sm-9">
        <input type="number"  class="form-control" name="limit" value="" placeholder="导出行数,要多少写多少,不写默认导出全部">
        </div>
      </div>

      <div class="form-group">
        <div class="col-sm-offset-2 col-xs-8 col-sm-9">
          <button type="submit" id="search" class="btn btn-lg btn-success">搜索</button>
          <button type="submit" id="download" class="btn btn-lg btn-primary" style="margin-left: 30px">下载</button>
        </div>
      </div>
    </form>

    <div class="table table-responsive table-condensed" style="margin-top:30px">
      <table class="table table-hover">
        <thead>
          <tr>
            <th>ID</th>
            <th>经度</th>
            <th>纬度</th>
            <th class="wrap">地址名</th>
            <th>备注</th>
            <th>创建时间</th>
          </tr>
        </thead>
        <tbody>
          <?php foreach ($list['list'] as $item): ?>
            <tr>
              <td><?php echo $item['id']; ?></td>
              <td><?php echo $item['lon']; ?></td>
              <td><?php echo $item['lat']; ?></td>
              <td title="<?php echo $item['address']; ?>">
                <div class="wrap">
                  <?php
if (mb_strlen($item['address']) > 20) {
    echo '...' . mb_substr($item['address'], -20);
} else {
    echo $item['address'];
}

?>

              </div>
              </td>
              <td title="<?php echo $item['remark']; ?>"><div><?php echo mb_substr($item['remark'], -15); ?></div></td>
              <td><?php echo $item['create_time']; ?></td>
            </tr>
          <?php endforeach;?>
        </tbody>
      </table>
      <?php echo $this->pagination->create_links(); ?>
    </div>
  </div>



</body>
</html>

这里写图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
之前在网上想找一个简单易用的周日历选择插件,发现这种前端周日历插件很少,而且很多文章写的周的算法都不是统一的,所以自己实现了一个基于jquery的周日历插件(还支持跳转到指定年份和周哦)。 插件中周的算法:每周以周日为起始,第一周以每年第一个星期四所在的周为第一周(网上找的好像这个算法比较正规) 实现的效果是在手机端,也可以在PC端用,毕竟功能才是主要的。如果觉得样式不入眼可以自行随意修改。 //调用周日历方法 var weekfn = new jcalendar_week({ element: "#jcalendar_week",//填充日历的dom元素 dayaddclass:function(date){ //添加某天时给添加类名(参数:1.日期)(返回类名字符串,多个以空格分开) return ""; }, dayclick:function(date,obj){ //day点击事件(参数:1.日期,2.所点击DOM元素) $(obj).addClass("calendar_day_act").siblings().removeClass("calendar_day_act"); } }); 点击上方显示当前年份和周的DOM部分可选择并跳转到指定年份和周。 插件提供的方法: //获取周第一天方法weekfirstdate(),传入年份和周数 console.log(weekfn.weekfirstdate(2018,36)); //获取传入日期为当年第几周getweeknum(),传入年,月,日(注:这里的月份从0开始) console.log(weekfn.getweeknum(2018,0,16)); //跳转到指定周confirmweek(),传入年份和周数 weekfn.confirmweek(getyear,getweek); //跳转到本周nowweek() weekfn.nowweek();
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

SHUIPING_YANG

你的鼓励是我创作的最大动力。

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值