NbDatePicker format feature won't work on component loaded with NbWindowService
- Lenguaje dominante
- TypeScript
- Estrellas
- 8.1k
- Forks
- 1.5k
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
### 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"
```
Guía de contribución
Evaluación
Este issue todavía no se ha evaluado.