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

modules/react-day-picker/types has no export for 'DateUtils' #865

Closed
mithunmaddur opened this issue Feb 12, 2019 · 3 comments · Fixed by #899
Closed

modules/react-day-picker/types has no export for 'DateUtils' #865

mithunmaddur opened this issue Feb 12, 2019 · 3 comments · Fixed by #899
Labels
good first issue Good for newcomers

Comments

@mithunmaddur
Copy link

mithunmaddur commented Feb 12, 2019

Error :react-day-picker/types"' has no exported member 'DateUtils'.

import DayPicker, { DateUtils } from 'react-day-picker';

public handleDayClick(day: any) {
    const range = DateUtils.addDayToRange(day);
    this.setState(range);
}

Have checking node modules types/utils.d.ts

export interface DateUtils {
  addDayToRange(day: Date, range: RangeModifier): RangeModifier;
  addMonths(d: Date, n: number): Date;
  clone(d: Date): Date;
  isDayAfter(day1: Date, day2: Date): boolean;
  isDayBefore(day1: Date, day2: Date): boolean;
  isDayBetween(day: Date, begin: Date, end: Date): boolean;
  isDayInRange(day: Date, range: RangeModifier): boolean;
  isFutureDay(day: Date): boolean;
  isPastDay(day: Date): boolean;
  isSameDay(day1: Date, day2: Date): boolean;
}
@mithunmaddur
Copy link
Author

mithunmaddur commented Feb 13, 2019

After changed index.d.ts from node modules

https://github.com/gpbl/react-day-picker/blob/7d2625288f022b9df0b94348b68ba08b0f3e584f/types/index.d.ts

Please suggest any fix for latest version to use

@gpbl
Copy link
Owner

gpbl commented Mar 7, 2019

Please send a PR thanks 🙏

@gpbl gpbl changed the title modules/react-day-picker/types"' has no exported member 'DateUtils'. No lint errors found modules/react-day-picker/types has no exported member 'DateUtils' Mar 7, 2019
@gpbl gpbl changed the title modules/react-day-picker/types has no exported member 'DateUtils' modules/react-day-picker/types has no export for 'DateUtils' Mar 7, 2019
@Nibblesh
Copy link

Nibblesh commented May 13, 2019

#904

Have changed the index.d.ts file to explicitly list exports from the utils file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
3 participants