Date-fns: No default import support

Created on 20 Apr 2017  路  3Comments  路  Source: date-fns/date-fns

Hello

I'm using angular 4 with AoT, and it has several requirements, on of them no default imports

Could you add support for it?

e.g. import { isWithinRange } from 'date-fns/is_within_range'

Thank you

Most helpful comment

Just do

import * as isWithinRange from 'date-fns/is_within_range';

All 3 comments

@djleonskennedy default exports will be added for esm submodule in v2.0.0: https://github.com/date-fns/date-fns/blob/v2/docs/esm.md#usage-with-typescript

Just do

import * as isWithinRange from 'date-fns/is_within_range';

@leshakoss @gausie thank you

Was this page helpful?
0 / 5 - 0 ratings