[SOLVED] How to import moment-timezone


#1

Hi, I’m trying to import moment-timezone to my app,
I did used typings to install moment-timezone by running this command:
typings install moment-timezone --ambient --save

and import to my page:

import * as moment from 'moment';
import 'moment-timezone';

Moment works but when I call moment.tz, it shows property tz not found.


#2

I found solution, run
typings install moment-node --save --ambient

will solve the problem.


#3

Should this work yet?

For me I got this error:
Unable to find “moment-node” (“npm”) in the registry.

Any idea?


#4

npm install --save @types/moment-timezone
https://www.npmjs.com/package/@types/moment-timezone


#5

Great! It worked! Thanks!


#6

Please share the xompelte working code