Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nb-datepicker with NbDateFnsModule not working #1088

Closed
1 of 2 tasks
tomadj opened this issue Dec 16, 2018 · 1 comment · Fixed by #1117
Closed
1 of 2 tasks

nb-datepicker with NbDateFnsModule not working #1088

tomadj opened this issue Dec 16, 2018 · 1 comment · Fixed by #1117

Comments

@tomadj
Copy link

tomadj commented Dec 16, 2018

Issue type

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

  • bug report
  • feature request

Issue description

Hello,

Error bellow is throw but NbDateFnsDateModule is imported :

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.

But not if I import NbMomentDateModule .

this error is throw in datepicker component :

NbBasePicker.prototype.ngOnChanges = function () {
        if (this.dateService instanceof NbNativeDateService && this.format) {
            throw new 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" ' +
                'https://akveo.github.io/nebular/docs/components/datepicker/overview#nbdatepickercomponent');
        }
    };

image

Maybe because NbDateFnsDateService extends NbNativeDateService ?

Thank's

Thomas

Angular, Nebular

    "@angular/cdk": "^7.1.1",
    "@angular/common": "^7.1.2",
    "@angular/compiler": "^7.1.2",
    "@angular/core": "^7.1.2",

    "@nebular/date-fns": "^3.0.1",
    "@nebular/moment": "^3.0.1",
    "@nebular/theme": "^3.0.1",
@ledsonsilva
Copy link

ledsonsilva commented Dec 26, 2018

I'm also having this problem!

I have imported @nebular/date-fns into my component but I still get this error on console, speaking to import.

Next images:

captura de tela em 2018-12-26 08-55-15

captura de tela em 2018-12-26 08-55-51

captura de tela em 2018-12-26 08-56-56

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants