简体   繁体   English

日期时间值未显示

[英]Date Time value is not showing

I am using Bootstrap DatetimePicker and I can select date and time. 我正在使用Bootstrap DatetimePicker,并且可以选择日期和时间。 But when I click a date it's it nos asking me for time. 但是,当我单击一个日期时,就没有时间要我了。 I mean I need to click the clock icon then I can set the time. 我的意思是我需要单击时钟图标,然后才能设置时间。

Another problem is when I store the date and time in the database and try to show the value in DateTime Picker text field it's not showing the value . 另一个问题是,当我将日期和时间存储在数据库中并尝试在DateTime Picker文本字段中显示值时, 它没有显示该值 I can see the value from inspecting the browser. 我可以从检查浏览器中看到价值。 Why it's not showing?? 为什么不显示?

DateTimePicker 的DateTimePicker

 <div class="input-group date" id="startdate">
    <input type="text" size="16" name="startDate"  value="{{$internalVisitors->startDate}}" id="start" class="form-control" />
    <span class="input-group-addon">
        <span class="glyphicon-calendar glyphicon"></span>
    </span>
</div>

if you want to show date time in your from then you must need to convert datetime format. 如果要从中显示日期时间,则必须转换日期时间格式。 laravel using carbon default. laravel使用碳默认。 for example 例如

 <div class="input-group date" id="startdate"> <input type="text" size="16" name="startDate" value="{{$internalVisitors->startDate->format('M d Y')}}" id="start" class="form-control" /> <span class="input-group-addon"> <span class="glyphicon-calendar glyphicon"></span> </span> </div> 

 <div class="input-group date" id="startdate"> <input type="text" size="16" name="startDate" value="2018-06-12T19:30" id="start" class="form-control" /> <span class="input-group-addon"> <span class="glyphicon-calendar glyphicon"></span> </span> </div> 

first of all you can see date-time format working manually or not. 首先,您可以看到日期时间格式是否手动工作。 if it's not working manually then first fix this. 如果无法手动操作,请先解决。 then you can fetch the data-time 然后您可以获取数据时间

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM