You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: replace the moment dependency with the date-fns library
BREAKING CHANGE:
1/ The `dayModifier` and `hourSegmentModifier` output objects now return pure date objects instead of moments
2/ If using the `CalendarMomentDateFormatter` you must now also provide moment to the calendar like so
```
import * as moment from 'moment';
import {
CalendarMomentDateFormatter,
CalendarDateFormatter,
MOMENT
} from './../angular2-calendar';
...
providers: [
{provide: CalendarDateFormatter, useClass: CalendarMomentDateFormatter},
{provide: MOMENT, useValue: moment}
]
```
3/ The week start day is now no longer determined by moment. You must manually pass it to the month and week view components like so
```
// the first day of the week is Monday
[weekStartsOn]="1"
```
4/ If using this library without a module bundler you must make sure the date-fns library is included in a script tag
Closes#48
Copy file name to clipboardExpand all lines: README.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ A calendar component that can display events on a month, week or day view. The s
25
25
26
26
Install through npm:
27
27
```
28
-
npm install --save angular2-calendar moment
28
+
npm install --save angular2-calendar
29
29
```
30
30
31
31
For a full e2e example see the [demo source](https://github.com/mattlewis92/angular2-calendar/blob/master/demo/demo.component.ts). Better docs to follow in the future!
0 commit comments