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

Property 'format' does not exist on type 'Duration' #149

Open
omaracrystal opened this issue Dec 4, 2020 · 1 comment
Open

Property 'format' does not exist on type 'Duration' #149

omaracrystal opened this issue Dec 4, 2020 · 1 comment

Comments

@omaracrystal
Copy link

Hello! I need some help trying to figure out what I am missing here to make this package work.

What I've done:
I have installed both moment and this package
"moment": "^2.24.0",
"moment-duration-format": "^2.3.2",

My Code:

import moment from 'moment';
import momentDurationFormatSetup from 'moment-duration-format';

function durationFormatter(minutes): string {
  momentDurationFormatSetup(moment);
  return moment.duration(minutes, "minutes").format();
}

Getting this error:
Property 'format' does not exist on type 'Duration'

@ricardo-dlc
Copy link

Seems that you are using TypeScript. Did you installed the @types/moment-duration-format for this lib?

npm i @types/moment-duration-format -D

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

No branches or pull requests

2 participants