bootstrap-datetimepicker仅在生产中显示dd / mm / yyyy [英] bootstrap-datetimepicker only displays dd/mm/yyyy in production
问题描述
bootstrap-datetimepicker仅在生产中显示dd / mm / yyyy,但在dev中工作正常。它应该显示今天的日期,并让我选择另一个日期,如果需要,但它坚持字符串dd / mm / yyyy..它的开发工作正常虽然..这是我的代码。
$(function(){
$(' #Date')。datetimepicker({
format:' L' ,
showClose: true ,
showClear: true ,
toolbarPlacement:' top'
});
< div class =form-group>
@ Html.LabelFor(model => model.Date,htmlAttributes:new {@class = control-label col-md-2})
< div class =col-md-10>
@ Html.EditorFor(model => model.Date,
new
{
htmlAttributes = new
{
@class =form-control
},
})
@ Html.ValidationMessageFor(model => model.Date,,new {@class =text-danger})
< / div>
< / div
>
我试图使用<$设置jquery中的默认日期p $ p> defaultDate:'@ DateTime.Now.ToShortDateString()',
并且它在dev中工作正常,但在生产中它只显示dd / mm / yyyy。
提前致谢。
(function(){
(' #Date')。datetimepicker({
format: ' L',
showClose: true ,
showClear: true ,
toolbarPlacement:' top'
});
< div class =form-group>
@Html。 LabelFor(model => model.Date,htmlAttributes:new {@class =control-label col-md-2})
< div class =col-md-10>
@ Html.EditorFor(model => model.Date,
new
{
htmlAttributes = new
{
@class =form-control
},
})
@ Html.ValidationMessageFor(model => model.Date,,new {@class =text-danger})
< ; / DIV>
< / div
>
我试图使用<$设置jquery中的默认日期p $ p> defaultDate:'@ DateTime.Now.ToShortDateString()',并且它在dev中工作正常,但在生产中它只显示dd / mm / yyyy。
提前谢谢。
您是否检查过生产中是否引用了jquery datetimepicker插件?
bootstrap-datetimepicker only displays dd/mm/yyyy in production but work fine in dev. It should be displaying todays date, and letting me chose another date if required, but its stuck with the string "dd/mm/yyyy".. Its working fine in development though.. Here is my code.
$(function () {
$('#Date').datetimepicker({
format: 'L',
showClose: true,
showClear: true,
toolbarPlacement: 'top'
});
<div class="form-group"> @Html.LabelFor(model => model.Date, htmlAttributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> @Html.EditorFor(model => model.Date, new { htmlAttributes = new { @class = "form-control" }, }) @Html.ValidationMessageFor(model => model.Date, "", new { @class = "text-danger" }) </div> </div
>
I have tried to set the default date in jquery using
defaultDate: '@DateTime.Now.ToShortDateString()',
and it works fine in dev, but in production it only displays dd/mm/yyyy.
Thanks in advance.
(function () {
('#Date').datetimepicker({ format: 'L', showClose: true, showClear: true, toolbarPlacement: 'top' });
<div class="form-group"> @Html.LabelFor(model => model.Date, htmlAttributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> @Html.EditorFor(model => model.Date, new { htmlAttributes = new { @class = "form-control" }, }) @Html.ValidationMessageFor(model => model.Date, "", new { @class = "text-danger" }) </div> </div>
I have tried to set the default date in jquery usingdefaultDate: '@DateTime.Now.ToShortDateString()',and it works fine in dev, but in production it only displays dd/mm/yyyy.
Thanks in advance.
Have you checked if the jquery datetimepicker plugin is referenced in production?
这篇关于bootstrap-datetimepicker仅在生产中显示dd / mm / yyyy的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!