我正试图在我的类中使用moment-timezone。 这是我的类型。
"moment": "github:DefinitelyTyped/DefinitelyTyped/moment/moment.d.ts#a1575b96ec38e916750629839d2110cb96210f89",
"moment-timezone": "github:DefinitelyTyped/DefinitelyTyped/moment-timezone/moment-timezone.d.ts#f8a90040348e83926f44e690b209769c4f88b961"
我的导入:
import * as moment from 'moment';
import * as tz from 'moment-timezone';
我的使用方法:
var jun = moment("2014-06-01T12:00:00Z");
jun.tz('America/Los_Angeles').format('ha z');
我的错误:
Property 'tz' does not exist on type 'Moment'.