Skip to content

Commit fc94ffc

Browse files
author
Irfan Maulana
committed
📖 add docs for presets
1 parent 4e6b127 commit fc94ffc

File tree

1 file changed

+36
-1
lines changed

1 file changed

+36
-1
lines changed

README.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,43 @@ You can pass these below props to `<rangedate-picker :props="props"></rangedate-
167167
*Description* : -
168168

169169
*Type* : Object
170+
Example :
171+
```javascript
172+
{
173+
today: function () {
174+
const n = new Date()
175+
const startToday = new Date(n.getFullYear(), n.getMonth(), n.getDate() + 1, 0, 0)
176+
const endToday = new Date(n.getFullYear(), n.getMonth(), n.getDate() + 1, 23, 59)
177+
return {
178+
label: presetRangeLabel[i18n].today,
179+
active: false,
180+
dateRange: {
181+
start: startToday,
182+
end: endToday
183+
}
184+
}
185+
}
186+
}
187+
```
170188

171-
*Default Value* : `{}`
189+
*Default Value* :
190+
```javascript
191+
{
192+
today: function () {
193+
return {
194+
// label: 'string', active: 'boolean', dateRange: {start: date, end: end}
195+
}
196+
},
197+
thisMonth: function () {
198+
},
199+
lastMonth: function () {
200+
},
201+
last7days: function () {
202+
},
203+
last30days: function () {
204+
}
205+
}
206+
```
172207

173208
+ **compact**
174209

0 commit comments

Comments
 (0)