Skip to content

Commit 6d56234

Browse files
authored
Merge pull request #23 from mazipan/master
📖 Add some docs
2 parents 2bc0ce6 + 7b38779 commit 6d56234

File tree

1 file changed

+141
-15
lines changed

1 file changed

+141
-15
lines changed

README.md

Lines changed: 141 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,25 +40,151 @@ Vue.use(VueRangedatePicker)
4040
<script src="https://unpkg.com/vue-rangedate-picker"></script>
4141
```
4242

43+
### Available Events
44+
45+
You can catch these below Events to `<rangedate-picker @events="events"></rangedate-picker>` template :
46+
47+
+ **selected**
48+
49+
*Description* : function that will `$emit` when datepicker set value, this function will get parameter response :
50+
```javascript
51+
{
52+
start: dateObjectStart
53+
end: dateObjectEnd
54+
}
55+
```
56+
4357
### Available Props
4458

59+
You can pass these below props to `<rangedate-picker :props="props"></rangedate-picker>` template :
60+
61+
+ **configs**
62+
63+
*Description* : -
64+
65+
*Type* : Object
66+
67+
*Default Value* : `{}`
68+
69+
+ **i18n**
70+
71+
*Description* : For text translation (currently: ID/EN)
72+
73+
*Type* : String
74+
75+
*Default Value* : `'ID'`
76+
77+
+ **months**
78+
79+
*Description* : Array of months name
80+
81+
*Type* : Array
82+
83+
*Default Value* :
84+
```javascript
85+
['Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni', 'Juli',
86+
'Agustus', 'September', 'Oktober', 'November', 'Desember']
87+
```
88+
89+
+ **shortDays**
90+
91+
*Description* : Array of days name in short
92+
93+
*Type* : Array
94+
95+
*Default Value* :
96+
```javascript
97+
['Min', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab']
98+
```
99+
100+
+ **captions**
101+
102+
*Description* : Object for text title and OK button
103+
104+
*Type* : Object
105+
106+
*Default Value* :
107+
```javascript
108+
{
109+
'title': 'Choose Dates',
110+
'ok_button': 'Apply'
111+
}
112+
```
113+
114+
+ **format**
115+
116+
*Description* : Date format
117+
118+
*Type* : String
119+
120+
*Default Value* : `'DD MMM YYYY'`
121+
122+
+ **styles**
123+
124+
*Description* : -
125+
126+
*Type* : Object
127+
128+
*Default Value* :
129+
```javascript
130+
{
131+
daysWeeks: 'calendar_weeks',
132+
days: 'calendar_days',
133+
daysSelected: 'calendar_days_selected',
134+
daysInRange: 'calendar_days_in-range',
135+
firstDate: 'calendar_month_left',
136+
secondDate: 'calendar_month_right',
137+
presetRanges: 'calendar_preset-ranges'
138+
}
139+
```
140+
141+
+ **initRange**
142+
143+
*Description* : -
144+
145+
*Type* : Object
146+
147+
*Default Value* : `null`
148+
149+
+ **startActiveMonth**
150+
151+
*Description* : Month will be shown in first launch
152+
153+
*Type* : Number
154+
155+
*Default Value* : `new Date().getMonth()`
156+
157+
+ **startActiveYear**
158+
159+
*Description* : Year will be shown in first launch
160+
161+
*Type* : Number
162+
163+
*Default Value* : `new Date().getFullYear()`
164+
165+
+ **presetRanges**
166+
167+
*Description* : -
168+
169+
*Type* : Object
170+
171+
*Default Value* : `{}`
172+
173+
+ **compact**
174+
175+
*Description* : Set to `'true'` if you want to make datepicker always shown in compact mode
176+
177+
*Type* : String
178+
179+
*Default Value* : `'false'`
180+
181+
+ **righttoleft**
182+
183+
*Description* : Set to `'true'` if you want datepicker shown align to `right`
45184

46-
| Props Name | Type | Default Value | Description |
47-
|--------------------------- |------------------|--------------- | ------------------------------------ |
48-
| configs | Object | {} | - |
49-
| i18n | String | 'ID' | For text translation (currently: ID/EN) |
50-
| months | Array | ['Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni', 'Juli', 'Agustus', 'September', 'Oktober', 'November', 'Desember'] | Array months name |
51-
| shortDays | Array | ['Min', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab'] | Array date name in short text |
52-
| captions | Object | `{'title': 'Choose Dates','ok_button': 'Apply'}` | Caption text like title and apply button |
53-
| format | String | 'DD MMM YYYY' | Date format |
54-
| styles | Object | `{daysWeeks: 'calendar_weeks', days: 'calendar_days', daysSelected: 'calendar_days_selected', daysInRange: 'calendar_days_in-range', firstDate: 'calendar_month_left', secondDate: 'calendar_month_right', presetRanges: 'calendar_preset-ranges'}` | Object set that contains classes use in calendar |
55-
| initRange | Object | - | - |
56-
| startActiveMonth | Number | `new Date().getMonth()` | - |
57-
| startActiveYear | Number | `new Date().getFullYear()` | - |
58-
| presetRanges | Object | - | - |
59-
| compact | String | 'false' | For set date to always shown |
60-
| righttoleft | String | 'false' | For set date box align from right |
185+
*Type* : String
61186

187+
*Default Value* : `'false'`
62188

63189
## Development
64190

0 commit comments

Comments
 (0)