laravel 日期时间选择器格式

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/43211657/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 15:42:56  来源:igfitidea点击:

DatetimePicker Format

phplaraveladminlte

提问by Mathieu Mourareau

I try to get 04/04/2017 - 14:58date format when I select a date and an hour:

04/04/2017 - 14:58当我选择一个日期和一个小时时,我尝试获取日期格式:

But actually with this form:

但实际上用这种形式:

<div class="input-group date form_datetime">
    <div class="input-group-addon">
        <i class="fa fa-calendar"></i>
    </div>
    <input type="datetime" name="datetime" class="form-control pull-right">
</div><!-- /.input group -->

I get 04 April 2017 - 14:58

我得到 04 April 2017 - 14:58

I don't know how to change this! For info I use AdminLTEfor laravel.

不知道怎么改!对于信息,我使用AdminLTEfor laravel

采纳答案by Laerte

Try to use formatwhen calling datepicker:

format调用 datepicker 时尝试使用:

<script type="text/javascript">
   $('#datepicker').datepicker({
      format: "DD/MM/YYYY h:mm"
   });
</script>

回答by Frank Liu

I suppose the issue is caused by the "datepicker" plugin used by AdminLTE. You can try to modify the returned date format that set. Which plugin that they use? Is it bootstrap-datepicker? Here's their official document: https://bootstrap-datepicker.readthedocs.io/en/latest/#

我想这个问题是由 AdminLTE 使用的“datepicker”插件引起的。您可以尝试修改设置的返回日期格式。他们使用哪个插件?它是引导程序日期选择器吗?这是他们的官方文档:https: //bootstrap-datepicker.readthedocs.io/en/latest/#