Skip to content

Commit 7e758ba

Browse files
author
Matt Lewis
committed
fix: use commonjs date-fns imports for rollup
1 parent ecbcbb6 commit 7e758ba

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/components/month/calendarMonthView.component.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {
1111
LOCALE_ID,
1212
Inject
1313
} from '@angular/core';
14-
import * as isSameDay from 'date-fns/is_same_day';
1514
import {
1615
CalendarEvent,
1716
WeekDay,
@@ -23,6 +22,9 @@ import {
2322
import { Subject } from 'rxjs/Subject';
2423
import { Subscription } from 'rxjs/Subscription';
2524

25+
declare const require: any;
26+
const isSameDay: any = require('date-fns/is_same_day');
27+
2628
@Component({
2729
selector: 'mwl-calendar-month-view',
2830
changeDetection: ChangeDetectionStrategy.OnPush,

src/providers/calendarNativeDateFormatter.provider.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
import * as getISOWeek from 'date-fns/get_iso_week';
21
import { CalendarDateFormatterInterface, DateFormatterParams } from './../interfaces/calendarDateFormatter.interface';
32

3+
declare const require: any;
4+
const getISOWeek: any = require('date-fns/get_iso_week');
5+
46
export class CalendarNativeDateFormatter implements CalendarDateFormatterInterface {
57

68
public monthViewColumnHeader({date, locale}: DateFormatterParams): string {

0 commit comments

Comments
 (0)