How to use moment-timezone in Angular 2 class?

前端 未结 4 2044
梦毁少年i
梦毁少年i 2021-02-07 09:24

I am trying to use moment-timezone in my class. This is my typings.

\"moment\": \"github:DefinitelyTyped/DefinitelyTyped/moment/moment.d.ts#a1575b96ec38e91675062         


        
4条回答
  •  孤城傲影
    2021-02-07 09:56

    Use Typescript @types packages and import it via import * as moment from 'moment-timezone'; You can use all moment methods and member vars as moment-timezone exports them.

    I have a complete example using SystemJS at How to use moment-timezone in Angular2 via SystemJs

提交回复
热议问题