简体   繁体   English

AngularJs 项目的 Firefox 浏览器中未显示日期时间

[英]Datetime is not shown in Firefox browser for AngularJs project

I have been working in an ASP.NET Webform project where AngularJs is used.我一直在使用 AngularJs 的 ASP.NET Webform 项目中工作。 In a form angularJs datetime picker is used to show date and time.在表格中 angularJs 日期时间选择器用于显示日期和时间。 Whenever the form is open datetime should show in the fields.每当表单打开时,日期时间都应显示在字段中。 The problem is it’s working in Chrome browser but in Firefox datetime is not showing while the page is load whenever the form is load in the first time.问题是它在 Chrome 浏览器中工作,但在 Firefox 中,当第一次加载表单时加载页面时,日期时间不显示 The field shows blank.该字段显示为空白。 The code for the datetime control is given bellow.日期时间控件的代码如下所示。

<div class="angular-date-picker">
    <angular-date-picker ng-model="UserDateTimeSettings.SelectedDate"
                         format="UserDateTimeSettings.DateFormat"
                         selected-date="UserDateTimeSettings.SetDatePickerDate"
                         date-changed="dateChanged(value)">
    </angular-date-picker>
</div>
<div ng-class="datePickerClass">
    <div class="angular-time-picker">
        <uib-timepicker ng-model="UserDateTimeSettings.TimePickerDate" 
                        ng-change="TimePickerChanged()" 
                        class="custombtn bs-theme-color" 
                        hour-step="hstep" 
                        minute-step="mstep" 
                        show-meridian="UserDateTimeSettings.IsAmPmVisible">
        </uib-timepicker>
    </div>
    <div class="due-date-zone">{{UserDateTimeSettings.AbbreviatedName}}</div>
</div>

In Firefox no error message is given in console either.在 Firefox 中,控制台中也没有给出错误消息。 Can anyone help me how to solve the problem.谁能帮我解决这个问题。

在此处输入图像描述

I found the problem.我发现了问题。 The problem is the date format.问题是日期格式。 The date which I am receiving from API is in incorrect format and Firefox does not parse it.我从 API 收到的日期格式不正确,Firefox 无法解析它。 This is why datepicker control can not show the date.这就是为什么 datepicker 控件不能显示日期的原因。

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

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