最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Datepicker and Laravel - Stack Overflow

programmeradmin3浏览0评论

I'm trying to add a datepicker to my form and it drives me crazy, I tried everything I know, I've search for hours and all I got is nothing so first here is my blade code:

    <div class="form-group">
{{ Form::label('date', 'Date:') }}
{{ Form::text('date', $payment->date, array('class' => 'datepicker','id' => 'datepicker')) }}                           
</div>

<script type="text/javascript">
$(function () {
$( "#datepicker" ).datepicker({
todayHighlight: true,
autoclose: true,
});
    });
</script>

Second here is a picture that show us the white long space that I wont to remove.

I tried to edit the css file but as far as I get that the css file has nothing to do with this problem.. so please guys help me.

I'm trying to add a datepicker to my form and it drives me crazy, I tried everything I know, I've search for hours and all I got is nothing so first here is my blade code:

    <div class="form-group">
{{ Form::label('date', 'Date:') }}
{{ Form::text('date', $payment->date, array('class' => 'datepicker','id' => 'datepicker')) }}                           
</div>

<script type="text/javascript">
$(function () {
$( "#datepicker" ).datepicker({
todayHighlight: true,
autoclose: true,
});
    });
</script>

Second here is a picture that show us the white long space that I wont to remove.

I tried to edit the css file but as far as I get that the css file has nothing to do with this problem.. so please guys help me.

Share Improve this question asked Mar 24, 2017 at 20:34 rooot_999rooot_999 3662 gold badges3 silver badges13 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 6

so here is the fix for this problem guys:

$( "#datepicker" ).datepicker({
format: "mm/dd/yy",
weekStart: 0,
calendarWeeks: true,
autoclose: true,
todayHighlight: true,
rtl: true,
orientation: "auto"
});

the key is the ("dir") code thank you.

This is how i use that datepicker with bootstrap:

<link href="/css/bootstrap-datetimepicker.min.css" rel="stylesheet">

{!! Form::label('date', 'Date: ' ) !!}
<div class="form-group input-group date">
    {!! Form::text('date', null, ['class' => 'form-control']) !!}
    <span class="input-group-addon">
        <span class="glyphicon glyphicon-calendar"></span>
    </span>
</div>


<script src="/js/moment.min.js"></script>
<script src="/js/bootstrap-datetimepicker.min.js"></script>
<script>
    $function(){
        $(.date).datetimepicker({
    });
</script>

Maybe you are using wrong datetimepicker. This is the one i am using:

https://eonasdan.github.io/bootstrap-datetimepicker/

发布评论

评论列表(0)

  1. 暂无评论