我正在开发基于ASPZero的有角度的应用程序。我有一个有效的日期,可以在'en'区域中与Bootstrap datepicker一起很好地显示。当我切换到'zh-Hans'区域性或'sv'区域性[以及其他]时,在浏览器控制台上会得到以下提示。
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="colorControlActivated">@color/colorPrimary</item>
<item name="android:timePickerDialogTheme">@style/PickerDialogCustom</item>
<item name="android:datePickerDialogTheme">@style/PickerDialogCustom</item>
<item name="alertDialogTheme">@style/AlertDialogCustom</item>
</style>
<style name="PickerDialogCustom" parent="AlertDialogCustom">
<item name="android:textColor">@color/colorPrimary</item>
<item name="android:textColorPrimary">@color/colorPrimaryDark</item>
<item name="colorControlNormal">@color/greyLight500</item>
<item name="android:layout_margin">2dp</item>
<item name="android:datePickerMode">spinner</item>
</style>
<style name="AlertDialogCustom" parent="Theme.AppCompat.Light.Dialog.Alert">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorAccent">@color/colorPrimary</item>
<item name="android:positiveButtonText">@color/colorPrimary</item>
<item name="android:negativeButtonText">@color/greyDark200</item>
<item name="buttonBarNegativeButtonStyle">@style/negativeButton</item>
<item name="android:datePickerStyle">@style/PickerDialogCustom</item>
</style>
我已经验证了core.js的以下代码中“ zh-Hans”的以下条件未定义日期。我试图为'zh-Hans'注册localedata
PersonalInfoComponent.html:22 ERROR Error: InvalidPipeArgument: 'Unable to convert "Invalid Date" into a date' for pipe 'DatePipe'
at invalidPipeArgumentError (common.js:4139)
at DatePipe.push../node_modules/@angular/common/fesm5/common.js.DatePipe.transform (common.js:5066)
at checkAndUpdatePureExpressionInline (core.js:22794)
at checkAndUpdateNodeInline (core.js:23366)
at checkAndUpdateNode (core.js:23324)
at debugCheckAndUpdateNode (core.js:23958)
at debugCheckDirectivesFn (core.js:23918)
at Object.eval [as updateDirectives] (PersonalInfoComponent.html:28)
at Object.debugUpdateDirectives [as updateDirectives] (core.js:23910)
at checkAndUpdateView (core.js:23306)
让我知道是否需要其他信息。