akveo / akveo/nebular

NbDatePicker format feature won't work on component loaded with NbWindowService

未关闭
#2,881 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
TypeScript
星标
8.1k
派生
1.5k
PR 合并指标
30 天内没有已合并 PR

描述

### Issue type

**I'm submitting a ...** (check one with "x")

* [ X] bug report
* [ ] feature request

### Issue description

**Current behavior:**
When using a nb-datepicker element inside a component loaded by NbWindowService (I'm making a feature where you can select a date inside a popup window), you can't use 'format' because the following error raises:

core.js:6210 ERROR Error: Can't format native date. To use custom formatting you have to install @nebular/moment or @nebular/date-fns package and import NbMomentDateModule or NbDateFnsDateModule accordingly.More information at "Formatting issue"

I have a NbDatePicker with format working without problems on its parent component, but the child (popup) won't work.

**Expected behavior:**
NbDatePicker works with format directive

**Steps to reproduce:**
1. Inside a main component, open another component (popup window) using NbWindowService
2. The PopupComponent won't load if it has a nb-datepicker with format directive, check codeinspector and you'll see the errors

**Related code:**

```
1. Inside a main component, open another component (popup window) using NbWindowService
async openWindowForm() {
this.windowService.open(PopupComponent, {
title: `Declarar Ganador`
});
}

2. The PopupComponent won't load if it has a nb-datepicker with format directive, check codeinspector and you'll see the errors




```

### Other information:

**npm, node, OS, Browser**
```
node v14.17.1
npm v6.14.13
OS Windows 10
Browser: BraveBrowser and GoogleChrome (last update each)
```

**Angular, Nebular**
```
"@angular/core": "^11.2.14",
"@nebular/theme": "7.0.0",
"@nebular/date-fns": "8.0.0"
```

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。