Skip to content

Commit ad7508e

Browse files
committed
Add viewDate option
1 parent 0b166e4 commit ad7508e

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

README.md

+14
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,20 @@ to current moment (if `true`). Granularity can be specified as a `string`.
207207

208208

209209

210+
#### viewDate
211+
212+
Default: `false`
213+
214+
Accepts: `date`, `moment`, `string`
215+
216+
```handlebars
217+
{{bs-datetimepicker date=myDate viewDate=customDate}}
218+
```
219+
220+
Pre-set the date / time, allowing to change default time from 12:00 AM.
221+
222+
223+
210224
#### viewMode
211225

212226
Default: `days`

addon/components/bs-datetimepicker.js

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ export default Component.extend({
5151
showClose: this.getWithDefault('showClose', defaults.showClose),
5252
showTodayButton: this.getWithDefault('showTodayButton', defaults.showTodayButton),
5353
useCurrent: this.getWithDefault('useCurrent', false),
54+
viewDate: this.getWithDefault('viewDate', defaults.viewDate),
5455
viewMode: this.getWithDefault('viewMode', defaults.viewMode)
5556
}).on('dp.change', e => {
5657
// Convert moment to js date or default to null

0 commit comments

Comments
 (0)