@@ -10,6 +10,8 @@ From version 3.0.0 onwards there will be a stable API with extensive features an
1010### Working demo
1111[ demo github project] ( https://github.com/eksrvb/material-calendar-demo )
1212
13+ If you want to give me feedback and don't want to open an issue on github, please fill out the [ form] ( https://forms.gle/W9TygXf65Yru3VHi7 )
14+
1315![ material-calendar-single-month] ( https://github.com/eksrvb/material-calendar/raw/main/docs/material-calendar-single-month.png )
1416![ material-calendar-three-months] ( https://github.com/eksrvb/material-calendar/raw/main/docs/material-calendar-three-months.png )
1517![ material-calendar-two-months-with-placeholder] ( https://github.com/eksrvb/material-calendar/raw/main/docs/material-calendar-two-months-with-placeholder.png )
@@ -46,78 +48,71 @@ In my case: `{provide: LOCALE_ID, useValue: 'de-DE' }`
4648
4749In your html:
4850``` html
49- <calendar-panels ></calendar-panels >
50- ```
51- and you are good to go ;)
52-
53- All options are shown here:
54-
55- ``` html
56- <calendar-panels
57- [mode] =" mode"
58- [placeholderDay] =" placeholder"
51+ <calendar-panel
52+ placeholderDay =" true"
5953 year =" 2020"
60- month =" 3 "
54+ month =" 10 "
6155 monthsBefore =" 1"
62- monthsAfter =" 1"
56+ monthsAfter =" 2"
57+ [dataSource] =" dataSource"
6358 [config] =" calendarConfig"
64- (clickDate) =" yourMethod($event)" >
65- </calendar-panels >
66- <!--
67- default mode = monthly
68- default placeholderDay = false
69- default year = current year
70- default month = current month
71- default monthsBefore = 1
72- default monthsAfter = 1
73- -->
59+ (clickDate) =" testMethod($event)" >
60+ </calendar-panel >
61+ <!--
62+ default placeholderDay = false override: boolean
63+ default year = current year override: year to start (number)
64+ default month = current month override: month to start (number)
65+ default monthsBefore = 0
66+ default monthsAfter = 0
67+ dataSource your custom dataSource
68+ config insert your configuration
69+ clickDate recive an click event from the component
70+ -->
7471```
72+
7573``` typescript
76- import { CalendarConfig } from ' material-calendar' ;
74+ import { CalendarConfig , DayC } from ' material-calendar' ;
7775
78- placeholder = false // boolean ...can be hardcoded in html
79- mode = ' monthly' // 'annual' | 'monthly' ...can be hardcoded in html
76+ placeholder = false // boolean
8077
8178calendarConfig : CalendarConfig = {
82- panelBgColor: ' #00677f ' , // use only hex or rbg colors
83- autoTextColor: true ,
84- textColor: ' #fff ' , // use only hex or rbg colors
85- displayYear: true ,
79+ calendarConfig: CalendarConfig = {
80+ renderMode: ' monthly ' , // 'annual' | 'monthly'
81+ selectMode: ' range ' , // 'click' | 'range'
82+ displayYear: false ,
8683 firstDayOfWeekMonday: true ,
87- todayColor: ' #fff' ,
88- panelWidth: ' 100%' , // can also be fix values such as 350px
8984 calendarWeek: true ,
90- switches: false ,
85+ switches: true ,
86+ }
9187}
92- ```
93- ``` javascript
94- /**
95- * @param {boolean} autoTextColor Sets the text color automatically, based on the backgroud colors
96- * @param {boolean} calendarWeek display the calendar week
97- * @param {boolean} displayYear displays the year next to the Month name
98- * @param {boolean} switches display switches in calendar component or not
99- * @param {string} panelBgColor sets the background color of the panel
100- * @param {string} textColor if autoTextColor false this must be set to a custom color
101- *
102- */
103- ```
10488
105- ## Planned features
106-
107- - insert your own calendar data and render the new template
108- - multiselect days optional (returns the daily span)
89+ dataSource : DayC [] = [
90+ {
91+ date: 1604185200000 ,
92+ backgroundColor: ' rgba(0, 0, 255, 0.5)' ,
93+ toolTip: ' Test ToolTip' ,
94+ badgeMode: ' Icon' ,
95+ badgeInt: 5 ,
96+ badgeIcon: ' edit'
97+ },
98+ {
99+ date: 1604199900000 ,
100+ backgroundColor: ' blue'
101+ }
102+ ]
103+ ```
109104
110- and many more...
111105
112106## Features
113107
114108- generate a nice calendar in material design
115109- get a date back with the annotation "clickDate" (see example)
110+ - insert your own calendar data and render the new template
111+ - multiselect days optional (returns the daily span)
116112
117113## Code scaffolding
118114
119115For code scaffolding, the project can be checked out from the public repository and pull requests can be made.
120-
121116
122117## Build
123118
0 commit comments