简体   繁体   中英

Datetime is not shown in Firefox browser for AngularJs project

I have been working in an ASP.NET Webform project where AngularJs is used. In a form angularJs datetime picker is used to show date and time. 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. 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. 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. This is why datepicker control can not show the date.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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